why is self not passed to id()? < solved >
larudwer at freenet.de
Thu Sep 4 22:45:15 CEST 2008
> The answer is fairly technical. For member functions to be bound to
> instances, they are required to have a __get__ method (which takes
> instance and owner as parameters). 'id' does not.
> (Why does 'id' not have a __get__ method?)
> By contrast,
> <method 'add' of 'set' objects>
> ['__call__', '__class__', '__delattr__', '__doc__', '__get__',
> ', '__hash__', '__init__', '__name__', '__new__', '__objclass__',
> '__reduce_ex__', '__repr__', '__setattr__', '__str__']
> 'set.add' does.
Thank you for the quick response.
However it gives me less hope that the little performance hack I had in mind
will ever work.
More information about the Python-list