MAINT: Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEX#15232
Conversation
eric-wieser
left a comment
There was a problem hiding this comment.
Looks good on a first pass, will let a second reviewer confirm
seberg
left a comment
There was a problem hiding this comment.
All changes here look good to me as well. Note that we have #if PY_VERSION_HEX < 0x03030000 and #if PY_VERSION_HEX >= 0x03050000 which also apply to 1.16+ (and 1.17). So that we can remove those just as well. (and one PY_VERSION_HEX < 0x03040400).
I am fine with moving that to a new PR though if you prefer.
|
|
||
| #if PY_VERSION_HEX >= 0x03000000 | ||
| #ifndef NPY_PY3K | ||
| #define NPY_PY3K 1 |
There was a problem hiding this comment.
I removing the internal use of this is one of the next steps.
There was a problem hiding this comment.
Yes, I'm also working on cleaning that up (in another CL)
sethtroisi
left a comment
There was a problem hiding this comment.
All changes here look good to me as well. Note that we have
#if PY_VERSION_HEX < 0x03030000and#if PY_VERSION_HEX >= 0x03050000which also apply to 1.16+ (and 1.17). So that we can remove those just as well. (and onePY_VERSION_HEX < 0x03040400).I am fine with moving that to a new PR though if you prefer.
I'm doing those in a separate CL as you have to inspect and process the logic while this is just verify matching #if #endif
|
|
||
| #if PY_VERSION_HEX >= 0x03000000 | ||
| #ifndef NPY_PY3K | ||
| #define NPY_PY3K 1 |
There was a problem hiding this comment.
Yes, I'm also working on cleaning that up (in another CL)
|
I think this can be pulled. (I don't want to sound pushy, I'm just excited to build the other PRs off this) |
|
One of these PRs should add a release note |
|
Thanks @sethtroisi |
Remove most of PY_MAJOR_VERSION guards that are no longer needed (after Python2 support is dropped)
There are a handful more of these that are more difficult (e.g. this or this) that will be handled in a 2nd pass