Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #5870 > unrolled thread
| Started by | Ethan Furman <ethan@stoneleaf.us> |
|---|---|
| First post | 2011-05-20 11:46 -0700 |
| Last post | 2011-05-20 11:46 -0700 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: hash values and equality Ethan Furman <ethan@stoneleaf.us> - 2011-05-20 11:46 -0700
| From | Ethan Furman <ethan@stoneleaf.us> |
|---|---|
| Date | 2011-05-20 11:46 -0700 |
| Subject | Re: hash values and equality |
| Message-ID | <mailman.1852.1305916429.9059.python-list@python.org> |
Ethan Furman wrote: > Several folk have said that objects that compare equal must hash equal, > and the docs also state this > http://docs.python.org/dev/reference/datamodel.html#object.__hash__ Two things I didn't make clear originally: I'm using Python3. My objects (of type Wierd) obey the premise of comparing equal also meaning hashing equal (with other objects of type Wierd). Perhaps my question could be narrowed down to: Should the docs actually say that "objects of the same *type* that compare equal must hash equal", or is there an underlying reason that objects of *different types* that happen to compare equal *must not* have different hashes? In other words, is the fact that everything tried so far in Python3 to break my toy code has failed to do so just an implementation detail of Python3? ~Ethan~
Back to top | Article view | comp.lang.python
csiph-web