[ python-Bugs-1179957 ] Missing def'n of equality for set elements

SourceForge.net noreply at sourceforge.net
Sun Apr 10 19:20:37 CEST 2005


Bugs item #1179957, was opened at 2005-04-09 17:10
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1179957&group_id=5470

Category: Documentation
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Nobody/Anonymous (nobody)
Summary: Missing def'n of equality for set elements

Initial Comment:
The documentation of the sets module doesn't describe the
properties of set elements that they must have to properly
work in sets (at least I didn't see it described).  In creating a
set of instances, I had to sort of stumble around and
discover that the class needed to define both __eq__ and
__hash__.  Either alone didn't seem to work.  Perhaps I've
got it all wrong and there's a better way to do things.  It would
be nice if the docs described things officially though.




----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2005-04-10 12:20

Message:
Logged In: YES 
user_id=80475

It does say that sets are implemented using dictionaries.  That 
implies that the requirements for set elements are the same as for 
dictionary keys.

Will see if I can add some clarifying wording.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1179957&group_id=5470


More information about the Python-bugs-list mailing list