Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-17 Thread Robert Kern
On Wed, Mar 16, 2011 at 15:21, Mark Wiebe mwwi...@gmail.com wrote: That sounds like a good fix to me. Whenever objects compare equal, they should hash to the same value. There is a limit to how far we can actually satisfy this requirement. For the implementation of np.dtype.__eq__(), we coerce

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-17 Thread Mark Wiebe
On Thu, Mar 17, 2011 at 2:35 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 15:21, Mark Wiebe mwwi...@gmail.com wrote: That sounds like a good fix to me. Whenever objects compare equal, they should hash to the same value. There is a limit to how far we can actually

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-17 Thread Christopher Barker
On 3/17/11 2:57 PM, Mark Wiebe wrote: Dtypes being mutable looks like a serious bug to me, it's violating the definition of 'hashable' given here: I can imagine other problems is would cause, as well -- is there any reason that dtypes should be mutable? -Chris -- Christopher Barker, Ph.D.

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-17 Thread Pauli Virtanen
Thu, 17 Mar 2011 15:23:19 -0700, Christopher Barker wrote: On 3/17/11 2:57 PM, Mark Wiebe wrote: Dtypes being mutable looks like a serious bug to me, it's violating the definition of 'hashable' given here: I can imagine other problems is would cause, as well -- is there any reason that

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-17 Thread Mark Wiebe
On Thu, Mar 17, 2011 at 3:30 PM, Pauli Virtanen p...@iki.fi wrote: Thu, 17 Mar 2011 15:23:19 -0700, Christopher Barker wrote: On 3/17/11 2:57 PM, Mark Wiebe wrote: Dtypes being mutable looks like a serious bug to me, it's violating the definition of 'hashable' given here: I can imagine

[Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Matthew Brett
Hi, Running the test suite for one of our libraries, there seems to have been a recent breakage of the behavior of dtype hashing. This script: import numpy as np data0 = np.arange(10) data1 = data0 - 10 dt0 = data0.dtype dt1 = data1.dtype assert dt0 == dt1 # always passes assert hash(dt0) ==

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Robert Kern
On Wed, Mar 16, 2011 at 01:18, Matthew Brett matthew.br...@gmail.com wrote: Hi, Running the test suite for one of our libraries, there seems to have been a recent breakage of the behavior of dtype hashing. This script: import numpy as np data0 = np.arange(10) data1 = data0 - 10 dt0 =

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Charles R Harris
On Wed, Mar 16, 2011 at 8:46 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 01:18, Matthew Brett matthew.br...@gmail.com wrote: Hi, Running the test suite for one of our libraries, there seems to have been a recent breakage of the behavior of dtype hashing.

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Charles R Harris
On Wed, Mar 16, 2011 at 8:56 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 16, 2011 at 8:46 AM, Robert Kern robert.k...@gmail.comwrote: On Wed, Mar 16, 2011 at 01:18, Matthew Brett matthew.br...@gmail.com wrote: Hi, Running the test suite for one of our libraries,

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Robert Kern
On Wed, Mar 16, 2011 at 10:27, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 16, 2011 at 8:56 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 16, 2011 at 8:46 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 01:18, Matthew Brett

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Matthew Brett
Hi, On Wed, Mar 16, 2011 at 9:21 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 10:27, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 16, 2011 at 8:56 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 16, 2011 at 8:46 AM, Robert Kern

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Robert Kern
On Wed, Mar 16, 2011 at 11:43, Matthew Brett matthew.br...@gmail.com wrote: I can git-bisect it later in the day, will do so unless it's become clear in the meantime. I'm almost done bisecting. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Robert Kern
On Wed, Mar 16, 2011 at 11:55, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 11:43, Matthew Brett matthew.br...@gmail.com wrote: I can git-bisect it later in the day, will do so unless it's become clear in the meantime. I'm almost done bisecting.

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Mark Wiebe
On Wed, Mar 16, 2011 at 10:00 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 11:55, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 11:43, Matthew Brett matthew.br...@gmail.com wrote: I can git-bisect it later in the day, will do so unless it's

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Robert Kern
On Wed, Mar 16, 2011 at 12:15, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Mar 16, 2011 at 10:00 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 11:55, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 11:43, Matthew Brett matthew.br...@gmail.com wrote:

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Mark Wiebe
On Wed, Mar 16, 2011 at 10:53 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 12:15, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Mar 16, 2011 at 10:00 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 11:55, Robert Kern robert.k...@gmail.com wrote: