Uh oh!
There was an error while loading. Please reload this page.
gh-109311: Remove support for non-complex/float types in __complex/float__ - #112680
gh-109311: Remove support for non-complex/float types in __complex/float__#112680skirpichev wants to merge 18 commits into
Conversation
skirpichev
commented
Apr 17, 2025
CC @vstinner maybe it's time, after 6 releases? |
vstinner
commented
Apr 17, 2025
I would prefer to wait for Python 3.15 alpha 1. IMO changing the behavior in Python 3.14 beta 1 is too late. |
skirpichev
commented
May 11, 2025
picnixz
left a comment
There was a problem hiding this comment.
Please update:
- Doc/whatsnew/3.15.rst: the C API removal section
- Maybe a
versionchangedentry underobject.__complex__andobject.__float__. - In a follow-up PR, let's also update "c-api-pending-removal-in-315" to notify this change in 3.13 & 3.14 (still, make a PR against main)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
picnixz
commented
May 11, 2025
I think you need to regenerate the NEWS entry as it's in an "old" folder |
skirpichev
commented
May 11, 2025
Are you sure it should be here? Strictly speaking, this affects not just C extensions. So far, this placed in "Others" subsection of "Removed" section.
Docs already says: Should return a value of the appropriate type.
In most (all?) cases you could just move news entry. |
Ah yes, my bad. Make it under the
Oh ok. No need for an additional note then. |
picnixz
left a comment
There was a problem hiding this comment.
The "pending-future-removal" document would still contain the deprecation notice so let's move it to 3.15.rst in a follow-up PR (or in this one, up to you). Since it's in "future removal", I don't know if we actually need a second round of discussion to decide on the version.
In the docs it says "should return", maybe we should be more precise and make it a "must return a float/complex". While users would see a DeprecationWarning, it's better for new online docs to state that we only want exact float/complex.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
vstinner
left a comment
There was a problem hiding this comment.
LGTM. I would like to hear @serhiy-storchaka on this issue, he wrote similar changes for other types.
serhiy-storchaka
commented
May 11, 2025
I have a completely opposite opinion. I will try to start a new discussion soon. |
vstinner
commented
May 25, 2025
Any update @serhiy-storchaka? |
picnixz
left a comment
There was a problem hiding this comment.
I'm ok with this change but I'd like to hear about Serhiy's objections.
vstinner
commented
Jun 2, 2025
@serhiy-storchaka started a discussion: https://discuss.python.org/t/about-type-conversion-special-methods/94212 |
skirpichev
commented
Jun 14, 2025
@vstinner, what do you think on Serhiy's arguments? I don't see too much feedback from the discussion so far. What should we do? I linked some old related discussion in comment. |
skirpichev
commented
Oct 10, 2025
@picnixz, what do you think on Serhiy's opinion? |
vstinner
commented
Oct 14, 2025
I replied on Discourse: https://discuss.python.org/t/about-type-conversion-special-methods/94212/8 |
vstinner
commented
Mar 10, 2026
Ping @serhiy-storchaka and @picnixz. |
This PR is stale because it has been open for 30 days with no activity. |
vstinner
commented
May 4, 2026
Yeah, sadly we couldn't reach an agreement on this tricky topic and Serhiy seems to want an opposite change. We can maybe retry making this change later, if we agree on a migration plan. |
Uh oh!
There was an error while loading. Please reload this page.