Are user-defined objects good keys?

asgard asgard at hellnet.cz
Sat Sep 29 18:45:57 EDT 2001


On Sat, 29 Sep 2001, Greg Weeks wrote:
> My central question is: Can I use user-defined mutable instances (that are
> "==" iff their ids are equal) as dictionary keys?  On my system I can.
> What about others?

I don't see the point. You could only find something in such dictionary by
using the exactly same object as key, not a different instance with the
same content. This probably isn't what would one expect.

Regards,
Jan Samohyl  





More information about the Python-list mailing list