Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Doc/c-api/complex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ Complex Numbers as Python Objects

This subtype of :c:type:`PyObject` represents a Python complex number object.

.. c:member:: Py_complex cval

The complex number value, using the C :c:type:`Py_complex` representation.

.. deprecated-removed:: next 3.20
Use :c:func:`PyComplex_AsCComplex` and
:c:func:`PyComplex_FromCComplex` to convert a
Python complex number to/from the C :c:type:`Py_complex`
representation.


.. c:var:: PyTypeObject PyComplex_Type

Expand Down
7 changes: 7 additions & 0 deletions Doc/deprecations/c-api-pending-removal-in-3.20.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Pending removal in Python 3.20
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* The ``cval`` field in :c:type:`PyComplexObject` (:gh:`128813`).
Use :c:func:`PyComplex_AsCComplex` and :c:func:`PyComplex_FromCComplex`
to convert a Python complex number to/from the C :c:type:`Py_complex`
representation.
2 changes: 2 additions & 0 deletions Doc/deprecations/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ C API deprecations

.. include:: c-api-pending-removal-in-3.18.rst

.. include:: c-api-pending-removal-in-3.20.rst

.. include:: c-api-pending-removal-in-future.rst
7 changes: 7 additions & 0 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,13 @@ Deprecated C APIs
signed integer type of the same size is now deprecated.
(Contributed by Serhiy Storchaka in :gh:`132629`.)

* Deprecate :c:member:`~PyComplexObject.cval` field of the the
:c:type:`PyComplexObject` type.
Use :c:func:`PyComplex_AsCComplex` and :c:func:`PyComplex_FromCComplex`
to convert a Python complex number to/from the C :c:type:`Py_complex`
representation.
(Contributed by Sergey B Kirpichev in :gh:`128813`.)

* Functions :c:func:`_Py_c_sum`, :c:func:`_Py_c_diff`, :c:func:`_Py_c_neg`,
:c:func:`_Py_c_prod`, :c:func:`_Py_c_quot`, :c:func:`_Py_c_pow` and
:c:func:`_Py_c_abs` are :term:`soft deprecated`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Functions :c:func:`_Py_c_sum`, :c:func:`_Py_c_diff`, :c:func:`_Py_c_neg`,
:c:func:`_Py_c_prod`, :c:func:`_Py_c_quot`, :c:func:`_Py_c_pow` and
previously undocumented :c:func:`_Py_c_abs` are :term:`soft deprecated`.
:c:func:`_Py_c_prod`, :c:func:`_Py_c_quot`, :c:func:`_Py_c_pow` and previously
undocumented :c:func:`_Py_c_abs` are :term:`soft deprecated`. Deprecate also
:c:member:`~PyComplexObject.cval` field of the :c:type:`PyComplexObject` type.
Patch by Sergey B Kirpichev.
6 changes: 3 additions & 3 deletions Tools/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Requirements file for external linters and checks we run on
# Tools/clinic, Tools/cases_generator/, and Tools/peg_generator/ in CI
mypy==1.16.1
mypy==1.17.1

# needed for peg_generator:
types-psutil==7.0.0.20250601
types-setuptools==80.9.0.20250529
types-psutil==7.0.0.20250801
types-setuptools==80.9.0.20250801
Loading