[Python-Dev] collections.idset and collections.iddict? (original) (raw)
Raymond Hettinger python at rcn.com
Tue Mar 7 01:08:02 CET 2006
- Previous message: [Python-Dev] collections.idset and collections.iddict?
- Next message: [Python-Dev] collections.idset and collections.iddict?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Neil Schemenauer]
I occasionally need dictionaries or sets that use object identity rather than hash to store items. Would it be appropriate to add these to the collections module?
Why not decorate the objects with a class adding a method: def hash(self): return id(self)
That would seem to be more Pythonic than creating custom variants of other containers.
Raymond
- Previous message: [Python-Dev] collections.idset and collections.iddict?
- Next message: [Python-Dev] collections.idset and collections.iddict?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]