[MERGE] Use slots consistently in InventoryEntry hierarchy -- regenerated against new head. Seeking another reviewer.

Robert Collins robertc at robertcollins.net
Thu Jun 1 04:33:43 BST 2006


On Tue, 2006-05-30 at 23:18 +0200, Jan Hudec wrote:


> I have regenerated it against new head now that the PatienceDiff passes
> tests. The patch did not change except for line numbers and attaching blank
> lines differently due to difflib/PatienceDiff.
> 
> It is still seeking another reviewer. The branch name quoted above is still
> valid.

+1 with one further change: the kind = lambda idiom is less clear than a
regular method based declaration:

@property
def kind(self):
    return 'symlink'

Etc.

unless there is a significant performance difference, please use that
form for properties.

That said, why is this a property and not an attribute ? If its to avoid
each type having a kind field, then just have a 'kind' slot in the base
class, and add a 'kind=None' keyword parameter to the base __init__ :
that will allow kind to be an attribute, and remove the duplicate effort
of having a property in each class. It will also allow the base __init__
to check it is given a kind and assert if it wasn't.

Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060601/d96ca295/attachment.pgp 


More information about the bazaar mailing list