Skip to content

BUG: fix hashing of long integers under python3 - #3800

Merged
charris merged 1 commit into
numpy:masterfrom
juliantaylor:fix-long-hash
Sep 26, 2013
Merged

charris merged 1 commit into
numpy:masterfrom
juliantaylor:fix-long-hash

Conversation

@juliantaylor

Copy link
Copy Markdown
Contributor

python3 long_hash is more complex than int_hash so instead of copying
into numpy call it via the Python capi.
Same for long long for wich the numpy hash function is not correct with
python 2.7 on i386.
Will be slower but doesn't need adapting each timy python changes.
closes #3793

python3 long_hash is more complex than int_hash so instead of copying
into numpy call it via the Python capi.
Same for long long for wich the numpy hash function is not correct with
python 2.7 on i386.
Will be slower but doesn't need adapting each timy python changes.
closes numpy#3793
@juliantaylor

Copy link
Copy Markdown
Contributor Author

tested on amd64, i386, win32 python 2 and 3
@cgohlke can you test it on win64 with py2 and py3?

@cgohlke

cgohlke commented Sep 26, 2013

Copy link
Copy Markdown
Contributor

All tests pass on Windows with Python 2.7 and 3.3, 32 and 64 bit.

@njsmith

njsmith commented Sep 26, 2013

Copy link
Copy Markdown
Member

Looks good to me
On 26 Sep 2013 21:50, "Christoph Gohlke" [email protected] wrote:

All tests pass on Windows with Python 2.7 and 3.3, 32 and 64 bit.

—
Reply to this email directly or view it on GitHubhttps://github.com//pull/3800#issuecomment-25202614
.

@charris

charris commented Sep 26, 2013

Copy link
Copy Markdown
Member

Thanks Julian.

charris added a commit that referenced this pull request Sep 26, 2013
BUG: fix hashing of long integers under python3
@charris
charris merged commit 856b544 into numpy:master Sep 26, 2013
@juliantaylor

Copy link
Copy Markdown
Contributor Author

I think it should it be backported to 1.8.
What about 1.7? could there be any issues produced by changing the hashing in a stable release?

@charris

charris commented Sep 26, 2013

Copy link
Copy Markdown
Member

It's a bug, so probably should go into 1.7 also. What is the difference for python 2?

@njsmith

njsmith commented Sep 27, 2013

Copy link
Copy Markdown
Member

Only issue I can think of with the stable release thing is that it might
change dict sort order, which sometimes reveals latent bugs in test suites
and things. My feeling is that ensuring correct lookup behavior is more
important.
On 27 Sep 2013 00:30, "Charles Harris" [email protected] wrote:

It's a bug, so probably should go into 1.7 also. What is the difference
for python 2?

—
Reply to this email directly or view it on GitHubhttps://github.com//pull/3800#issuecomment-25212260
.

@juliantaylor

Copy link
Copy Markdown
Contributor Author

python2 is only broken on 32 bit with long long types, e.g. np.int64(-2**32)

@charris charris mentioned this pull request Sep 27, 2013
@juliantaylor

Copy link
Copy Markdown
Contributor Author

#3747 has not been backported to 1.8 and 1.7, this PR depends on it.

@juliantaylor

Copy link
Copy Markdown
Contributor Author

nevermind, I forgot to pull on the maintainance branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scalar int hashing broken on 64 bit python3

4 participants