-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
_Py_c_sum, _Py_c_diff, etc - were removed from Python.h #112019
Comments
CC @vstinner |
If these functions are useful, I would prefer to make them public. Previous discussion about this private API: #106320 (comment) |
Add functions operating on Py_complex numbers: * Py_complex_sum() * Py_complex_diff() * Py_complex_neg() * Py_complex_prod() * Py_complex_quot() * Py_complex_pow() * Py_complex_abs()
Add functions operating on Py_complex numbers: * Py_complex_sum() * Py_complex_diff() * Py_complex_neg() * Py_complex_prod() * Py_complex_quot() * Py_complex_pow() * Py_complex_abs()
Add functions operating on Py_complex numbers: * Py_complex_sum() * Py_complex_diff() * Py_complex_neg() * Py_complex_prod() * Py_complex_quot() * Py_complex_pow() * Py_complex_abs()
Add functions operating on Py_complex numbers: * Py_complex_sum() * Py_complex_diff() * Py_complex_neg() * Py_complex_prod() * Py_complex_quot() * Py_complex_pow() * Py_complex_abs() Add basic tests on these functions in test_capi.
@skirpichev: Do you use these functions? Do you know a project using these functions? A code search on PyPI top 5,000 projects only found 1 line using |
@mdickinson, should we expose these functions and details of the Py_complex struct, what do you think?
Code search shows they aren't used too much.
Not outside of CPython itself. PS: (I'm moving discussion from #106320)
It seems, see e.g. (https://discuss.python.org/t/33433/23, llvm/llvm-project#8904), that none of popular compilers (icc maybe an exception) support this extension correctly. |
Members of the The |
Also they take struct by value, a bit strange API. |
I restored removed Later, we should consider deprecating these functions and make them fully internal. I restored these functions because they are documented. |
Maybe we could keep this issue for that? |
I prefer to wait until a migration path is decision on how to get rid of private functions (which were reverted in Python 3.13. alpha2): capi-workgroup/api-evolution#24 |
See #106339 and #106320. But these functions are documented as public: https://docs.python.org/3/c-api/complex.html#complex-numbers-as-c-structures
I think c38c666 should be partially reverted and
_Py_c_abs
- documented.On another hand, quick github search shows very little examples of using above functions. See also #106320 (comment). So, in a long term I propose to deprecate this API and related functions (PyComplex_FromCComplex/PyComplex_AsCComplex). Who knows, maybe someday we could use
<complex.h>
...Linked PRs
The text was updated successfully, but these errors were encountered: