-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: Disable hex(np.floating) and oct(np.floating) on python 2 #10765
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: Disable hex(np.floating) and oct(np.floating) on python 2 #10765
Conversation
94591ee
to
9918e22
Compare
* cfloat, cdouble, clongdouble)*2# | ||
* #oper = oct*7, hex*7# | ||
*/ | ||
#define @name@_@oper@ NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's precedent for this approach with #define @name@_invert NULL
I wonder if this is worth doing at this late point when we are about to drop 2.7 support. It has the potential to cause some pain downstream and I don't see that we gain much benefit. |
For users planning to upgrade to python 3 anyway, this is pain they'll experience when they transition - arguably it's worth getting some of the pain out of the way. |
I'd be surprised if this causes pain downstream - |
We should either close this or add tests and get it in |
@mattip: Into 1.16.x, you mean? |
yes |
9918e22
to
7654b69
Compare
Updated with tests |
This makes them match the behavior of hex(float) and oct(float)
7654b69
to
c123a5d
Compare
Tests are failing with infinite recursion |
Bizarre... |
Ah, this is the fun scalar type recursion where Longdouble seem to be the only type that forms a loop here (#8547) |
Leave be to avoid churn. |
This makes them match the behavior of hex(float) and oct(float) on python 2
Note that
np.float16.__hex__
still exists, which callsnp.generic.__hex__
→ndarray.__hex__
→np.float16::tp_number.nb_hex
. Unfortunately #9972 means__hex__
andnb_hex
are out of sync.