[Python-Dev] collections.idset and collections.iddict?

2006-03-06 Thread 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? Neil ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] collections.idset and collections.iddict?

2006-03-06 Thread Brett Cannon
On 3/6/06, Neil Schemenauer [EMAIL PROTECTED] wrote: 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? Yeah, that would be the place for them. But would it be more helpful to

Re: [Python-Dev] collections.idset and collections.iddict?

2006-03-06 Thread Raymond Hettinger
[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)

Re: [Python-Dev] collections.idset and collections.iddict?

2006-03-06 Thread Guido van Rossum
On 3/6/06, Raymond Hettinger [EMAIL PROTECTED] wrote: [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

Re: [Python-Dev] collections.idset and collections.iddict?

2006-03-06 Thread Jack Diederich
On Mon, Mar 06, 2006, Guido van Rossum wrote: On 3/6/06, Raymond Hettinger [EMAIL PROTECTED] wrote: [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?

Re: [Python-Dev] collections.idset and collections.iddict?

2006-03-06 Thread Bob Ippolito
On Mar 6, 2006, at 4:14 PM, Guido van Rossum wrote: On 3/6/06, Raymond Hettinger [EMAIL PROTECTED] wrote: [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

Re: [Python-Dev] collections.idset and collections.iddict?

2006-03-06 Thread Alex Martelli
On Mar 6, 2006, at 4:43 PM, Bob Ippolito wrote: On Mar 6, 2006, at 4:14 PM, Guido van Rossum wrote: ... I wonder if this use case and the frequently requested case-insensitive dict don't have some kind of generalization in common -- perhaps a dict that takes a key function a la

Re: [Python-Dev] collections.idset and collections.iddict?

2006-03-06 Thread Ian Bicking
Guido van Rossum wrote: On 3/6/06, Raymond Hettinger [EMAIL PROTECTED] wrote: [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