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 ob_shash deprecation warning on Python 3.11 #21317

Closed
felixxm opened this issue Apr 10, 2022 · 0 comments · Fixed by #21321
Closed

BUG: Fix ob_shash deprecation warning on Python 3.11 #21317

felixxm opened this issue Apr 10, 2022 · 0 comments · Fixed by #21321
Labels

Comments

@felixxm
Copy link
Contributor

felixxm commented Apr 10, 2022

Describe the issue:

ob_shash is deprecated on Python 3.11:

numpy/core/src/multiarray/scalarapi.c:709:13: warning: ‘ob_shash’ is deprecated [-Wdeprecated-declarations]

This looks unnecessary 🤔, cached hash value for obj should not be computed yet:

((PyBytesObject *)obj)->ob_shash = -1;

Reproduce the code example:

Run tests on Python 3.11.

Error message:

numpy/core/src/multiarray/scalarapi.c:709:13: warning: ‘ob_shash’ is deprecated [-Wdeprecated-declarations]

NumPy/Python version information:

1.23.0.dev0+1020.g08569fcf0 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0]

felixxm added a commit to felixxm/numpy that referenced this issue Apr 11, 2022
…umpy#21317.

This is unnecessary because a cached hash value should not be computed
for obj. Moreover PyBytesObject.ob_shash was deprecated in Python 3.11.
@mattip mattip closed this as completed in 17c1c5e Apr 21, 2022
mattip added a commit that referenced this issue Apr 21, 2022
BUG: Stop using PyBytesObject.ob_shash deprecated in Python 3.11, fixes #21317.
charris pushed a commit to charris/numpy that referenced this issue May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant