Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: fix hashing of long integers under python3 #3800

Merged
merged 1 commit into from
Sep 26, 2013

Conversation

juliantaylor
Copy link
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
Contributor Author

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

@cgohlke
Copy link
Contributor

cgohlke commented Sep 26, 2013

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

@njsmith
Copy link
Member

njsmith commented Sep 26, 2013

Looks good to me
On 26 Sep 2013 21:50, "Christoph Gohlke" notifications@github.com 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
Copy link
Member

charris commented Sep 26, 2013

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
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
Copy link
Member

charris commented Sep 26, 2013

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

@njsmith
Copy link
Member

njsmith commented Sep 27, 2013

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" notifications@github.com 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
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
Contributor Author

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

@juliantaylor
Copy link
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