Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(16967)

Issue 26052: Hashing protocol for dtypes (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 1 month ago by cournape
Modified:
14 years, 8 months ago
Reviewers:
stefanv
Base URL:
http://svn.python.org/view/*checkout*/python/trunk/
Visibility:
Public.

Description

First shot - seems to work for simple compound, subarray and builtin dtypes

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+356 lines, -1 line) Patch
numpy/core/setup.py View 1 chunk +1 line, -0 lines 0 comments Download
numpy/core/src/hashdescr.c View 1 chunk +287 lines, -0 lines 0 comments Download
numpy/core/src/multiarraymodule.c View 2 chunks +2 lines, -1 line 0 comments Download
numpy/core/tests/test_dtype.py View 1 chunk +66 lines, -0 lines 0 comments Download

Messages

Total messages: 4
cournape
15 years, 1 month ago (2009-03-12 12:08:18 UTC) #1
stefanv
In [20]: hash(np.dtype([('t', float),('y', float)])) == hash(np.dtype([('x', float), ('y', float)])) Out[20]: True But In [3]: ...
15 years, 1 month ago (2009-03-13 16:03:39 UTC) #2
stefanv
In [34]: hash(np.dtype([('f2', [('f2', np.int16)])])) Out[34]: 148882832 In [35]: hash(np.dtype([('f1', [('f2', np.int16)])])) Out[35]: 148882832
15 years, 1 month ago (2009-03-13 17:02:57 UTC) #3
stefanv
15 years, 1 month ago (2009-03-13 17:03:19 UTC) #4
On 2009/03/13 16:03:39, Stefan wrote:
> In [20]: hash(np.dtype([('t', float),('y', float)])) == hash(np.dtype([('x',
> float), ('y', float)]))
> Out[20]: True
> 
> But
> 
> In [3]: a,b = np.dtype([('t', float),('y', float)]), np.dtype([('x', float),
> ('y', float)])
> In [7]: hash(a) == hash(b)
> Out[7]: False
> 
> I must be doing something silly.  Do you know what?

Clean build fixed this issue.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b