◐ Shell
clean mode source ↗

gh-112019: Add Py_complex_abs() function by vstinner · Pull Request #112107 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented

Nov 15, 2023

edited by github-actions Bot

Loading

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.

@vstinner

@vstinner

Only the numba is known to call _Py_c_pow(). Apparently, _Py_c functions are not used in the wild apart of the numba case. For now, I mark this PR as a draft.

@vstinner

I'm no longer convinced that we should make these APIs public. See #112019 discussion. I close this PR.

Labels

1 participant

@vstinner