Skip to content

BUG: nan-objects lookup fails with Python3.10 #41988

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

Merged
merged 5 commits into from
Jun 17, 2021

Conversation

realead
Copy link
Contributor

@realead realead commented Jun 13, 2021

This builds upon #41952, which should be integrated first.

We no longer can assume that the CPython's hash function for elements with NaN (float, complex, tuple) will do the right thing (see python/cpython@a07da09) and thus need to replace the default CPython's hash-function with our own, similar to the way we handle equality-operator.

We need to use old CPython hash functions for float and complex, because we would like to keep the equivalency int(k)==float(k)==complex(k, 0.0).

We have more freedom with tuple's hash-function, but still use CPython's implementation, so we get old hash-values.

@realead realead changed the title WIP: BUG: nan-objects lookup fails with Python3.10 BUG: nan-objects lookup fails with Python3.10 Jun 17, 2021
@realead
Copy link
Contributor Author

realead commented Jun 17, 2021

No significant changes in performance in the asv-bench.

@jreback jreback added this to the 1.3 milestone Jun 17, 2021
@jreback jreback merged commit 098e3d7 into pandas-dev:master Jun 17, 2021
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Jun 17, 2021
@jreback
Copy link
Contributor

jreback commented Jun 17, 2021

thanks @realead

the reason merging these to 1.3 is since 3.10 will be out before 1.4/2.0 :->

@jreback
Copy link
Contributor

jreback commented Jun 17, 2021

@meeseeksdev backport 1.3.x

@lumberbot-app
Copy link

lumberbot-app bot commented Jun 17, 2021

Something went wrong ... Please have a look at my logs.

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

Successfully merging this pull request may close these issues.

BUG: nan-objects lookup fails in Python3.10
2 participants