Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing def'n of equality for set elements #41832

Closed
smontanaro opened this issue Apr 9, 2005 · 3 comments
Closed

Missing def'n of equality for set elements #41832

smontanaro opened this issue Apr 9, 2005 · 3 comments
Labels
docs Documentation in the Doc dir

Comments

@smontanaro
Copy link
Contributor

BPO 1179957
Nosy @smontanaro, @rhettinger

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2005-04-10.17:30:04.000>
created_at = <Date 2005-04-09.22:10:45.000>
labels = ['docs']
title = "Missing def'n of equality for set elements"
updated_at = <Date 2005-04-10.17:30:04.000>
user = 'https://github.com/smontanaro'

bugs.python.org fields:

activity = <Date 2005-04-10.17:30:04.000>
actor = 'rhettinger'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2005-04-09.22:10:45.000>
creator = 'skip.montanaro'
dependencies = []
files = []
hgrepos = []
issue_num = 1179957
keywords = []
message_count = 3.0
messages = ['24971', '24972', '24973']
nosy_count = 2.0
nosy_names = ['skip.montanaro', 'rhettinger']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1179957'
versions = ['Python 2.5']

@smontanaro
Copy link
Contributor Author

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.

@smontanaro smontanaro added the docs Documentation in the Doc dir label Apr 9, 2005
@smontanaro smontanaro added the docs Documentation in the Doc dir label Apr 9, 2005
@rhettinger
Copy link
Contributor

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.

@rhettinger
Copy link
Contributor

Logged In: YES
user_id=80475

Updated both libstdtypes.tex and libsets.tex with explicit
documentation for element requirements.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

2 participants