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

Pauli Virtanen pav@iki...
Thu Mar 17 17:30:43 CDT 2011

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 dtypes should be mutable?

Changing field names via the `names` attribute. AFAIK, the other 
attributes in dtypes are not mutable, and mutability was added long ago 
as a workaround for `.view()` not handling name changes properly.

There's possibly some code out there that touches the `names` attribute, 
so it's not clear if this can be fixed in the 1.x series.

Pauli Virtanen

More information about the NumPy-Discussion mailing list