gh-128813: deprecate cval field of the PyComplexObject struct#137271
Conversation
7cb20b1 to
7b72948
Compare
July 31, 2025 11:52
7b72948 to
40fc415
Compare
August 1, 2025 07:49
|
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? |
Sorry, something went wrong.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
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: |
Sorry, something went wrong.
I don't think we want to maintain two implementations. |
Sorry, something went wrong.
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 |
Sorry, something went wrong.
|
BTW, I can do planned reorganization of docs (#137261 (comment)) here. But, probably, it worth a separate pr. |
Sorry, something went wrong.
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. |
Sorry, something went wrong.
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. |
Sorry, something went wrong.
|
Ok, removal deferred to 3.20. |
Sorry, something went wrong.
|
Thanks! A wording nitpick; but this is ready to go. @vstinner, do you agree? |
Sorry, something went wrong.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
vstinner
left a comment
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
9743d06
into
python:main
Aug 8, 2025
…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