Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-128813: deprecate cval field of the PyComplexObject struct#137271
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
skirpichev commented Jul 31, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
7cb20b1 to 7b72948Compare7b72948 to 40fc415Compareencukou commented Aug 1, 2025
Per PEP-387, the preferred deprecation period is 5 years (so the removal would be in 3.20). Is there a reason to accelerate that? |
Uh oh!
There was an error while loading. Please reload this page.
Misc/NEWS.d/next/C_API/2025-07-31-11-53-38.gh-issue-128813.axQIxb.rst Outdated Show resolvedHide resolved
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
skirpichev commented Aug 1, 2025
Hmm, probably not soo much. I would bet, that M$ compiler will not have complex types in 3.17 nor in 3.20. Though, maybe we could keep legacy code with Quick search on GH give me very few project (two), that use this undocumented field: |
Uh oh!
There was an error while loading. Please reload this page.
encukou commented Aug 4, 2025
I don't think we want to maintain two implementations. |
skirpichev commented Aug 6, 2025
One of them will be trivial, much like PyFloatObject now. I think that this opportunity could be at least explored. Unless we aren't going into introduction of the imaginary type (which I think is The Right Thing), Annex G double _Complex type - is the future. I'm fine to delay removal to 3.20. But impact of this deprecation looks to be low and I prefer if it will add as less constraints on us as possible. CC @vstinner |
skirpichev commented Aug 6, 2025
BTW, I can do planned reorganization of docs (#137261 (comment)) here. But, probably, it worth a separate pr. |
Uh oh!
There was an error while loading. Please reload this page.
vstinner commented Aug 7, 2025
IMO it's fine to only deprecate for 2 releases since it's rare to use the C API to access PyComplex objects. I'm not suprised that a code search only finds 2 projects. |
encukou commented Aug 7, 2025
If we already need to keep the existing implementation (for MS, and any other compilers without Annex G support), I don't see any benefit in adding a second implementation -- even if it's trivial.
I still see no strong reason to use a shorter-than-default deprecation period. |
skirpichev commented Aug 7, 2025
Ok, removal deferred to 3.20. |
Uh oh!
There was an error while loading. Please reload this page.
encukou commented Aug 8, 2025
Thanks! A wording nitpick; but this is ready to go. @vstinner, do you agree? |
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
vstinner left a comment
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.
LGTM
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
9743d06 into python:mainUh oh!
There was an error while loading. Please reload this page.
…ython#137271) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
📚 Documentation preview 📚: https://cpython-previews--137271.org.readthedocs.build/en/137271/c-api/complex.html