js at jeannot.org
Sun Feb 29 03:05:48 CET 2004
I'm trying to create an object to be used as a key in a dictionary,
where comparison (for key retrieval) would be done by 'is' instead of
(__eq__ is defined in this object, but serve another purpose and does
not return a boolean).
Is defining __hash__ as id(self) sufficient to guarantee that __eq__
will never be called by the dict implementation ? (it seems to work in
If not, how to ensure __eq__ will never be called ?
Thank you very much in advance !
More information about the Python-list