A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-November/122530.html below:

[Python-Dev] [Python-checkins] cpython (3.3): Issue #15814: Use hash function that is compatible with the equality

[Python-Dev] [Python-checkins] cpython (3.3): Issue #15814: Use hash function that is compatible with the equality [Python-Dev] [Python-checkins] cpython (3.3): Issue #15814: Use hash function that is compatible with the equalityAntoine Pitrou solipsis at pitrou.net
Sat Nov 3 11:17:48 CET 2012
On Sat, 3 Nov 2012 10:59:23 +0100
Stefan Krah <stefan at bytereef.org> wrote:
> Nick Coghlan <ncoghlan at gmail.com> wrote:
> > > +        if (b == c):
> > > +            self.assertEqual(hash(b), hash(c))
> > 
> > These checks could do with a comment explaining why the if statements
> > are needed (I'm assuming something to do with memory order).
> 
> The checks aren't needed; they were supposed to spell out the equality-hash
> relationship.

Better use assertEqual(), then.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4