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

2012-11-03 Thread Nick Coghlan
On Sat, Nov 3, 2012 at 3:07 AM, stefan.krah python-check...@python.org wrote: +# equality-hash invariant +x = ndarray(list(range(12)), shape=[12], format='B') +a = memoryview(nd) + +y = ndarray(list(range(12)), shape=[12], format='b') +b =

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

2012-11-03 Thread Stefan Krah
Nick Coghlan ncogh...@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

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

2012-11-03 Thread Antoine Pitrou
On Sat, 3 Nov 2012 10:59:23 +0100 Stefan Krah ste...@bytereef.org wrote: Nick Coghlan ncogh...@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