Skip to content

Conversation

@hpkfft
Copy link
Contributor

@hpkfft hpkfft commented Sep 30, 2025

This PR removes deprecated functionality, as requested in #29835

Copy link
Member

@seberg seberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks a lot @hpkfft, I think Matti agreed it's about time, so I think we can give this a shot.

If someone finds this PR and has a larger fallout, please let us know, in theory we could e.g. escalate to a VisibleDeprecationWarning (but in practice, I think users also tend to ignore warnings either way).

NumPy 1.25 was 2.5 years ago (by the time this is released), which seems OK for this.
(We are not good about timely expiring, but this was always a noisy one, so I think it had to be well above 1 year of deprecation.)

assert_equal(6.0, float_func(np.bytes_(b'6')))
assert_equal(6.1, float_func(np.bytes_(b'6.1')))
assert_equal(7.0, float_func(np.str_('7')))
assert_equal(7.1, float_func(np.str_('7.1')))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New tests? I don't say no to new tests ever :). (I think float and __float__ is a bit double, since float just calls __float__, but OK.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I thought it best to be careful.

Since Python 3.8, float() will fall back to __index__():

For a general Python object x, float(x) delegates to x.__float__(). If __float__() is not defined then it falls back to __index__().

@seberg
Copy link
Member

seberg commented Oct 1, 2025

Windows FP16 seems to be very broken on some hardware or so, restarted CI, but whatever is going on, it is unrelated to this PR anyway.

@seberg seberg merged commit e7276da into numpy:main Oct 1, 2025
78 of 80 checks passed
@hpkfft hpkfft deleted the issue29835 branch October 1, 2025 15:38
bwhitt7 pushed a commit to bwhitt7/numpy that referenced this pull request Oct 7, 2025
… scalar (numpy#29841)

This PR removes deprecated functionality, as requested in numpygh-29835.  The functionality will be deprecated for about 2.5 years (NumPy 1.25).
IndifferentArea pushed a commit to IndifferentArea/numpy that referenced this pull request Dec 7, 2025
… scalar (numpy#29841)

This PR removes deprecated functionality, as requested in numpygh-29835.  The functionality will be deprecated for about 2.5 years (NumPy 1.25).
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.

2 participants