Skip to content

Commit aa829e1

Browse files
committed
gh-141004: Mark up docs of old PyMem macros
Their docs-only deprecation notice appeared 2.0: https://docs.python.org/release/2.0/api/memoryInterface.html but not 1.6: https://docs.python.org/release/2.0/api/memoryInterface.html Nowadays we call this soft deprecation. Since PEP 445, they are now direct aliases; there are no (additional) binary compatibility concerns over the preferred names.
1 parent 510ab7d commit aa829e1

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

Doc/c-api/memory.rst

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -293,17 +293,23 @@ The following type-oriented macros are provided for convenience. Note that
293293
294294
Same as :c:func:`PyMem_Free`.
295295
296-
In addition, the following macro sets are provided for calling the Python memory
297-
allocator directly, without involving the C API functions listed above. However,
298-
note that their use does not preserve binary compatibility across Python
299-
versions and is therefore deprecated in extension modules.
300-
301-
* ``PyMem_MALLOC(size)``
302-
* ``PyMem_NEW(type, size)``
303-
* ``PyMem_REALLOC(ptr, size)``
304-
* ``PyMem_RESIZE(ptr, type, size)``
305-
* ``PyMem_FREE(ptr)``
306-
* ``PyMem_DEL(ptr)``
296+
.. c:macro:: PyMem_MALLOC(size)
297+
PyMem_NEW(type, size)
298+
PyMem_REALLOC(ptr, size)
299+
PyMem_RESIZE(ptr, type, size)
300+
PyMem_FREE(ptr)
301+
PyMem_DEL(ptr)
302+
303+
These macros are :term:`soft deprecated` aliases for the APIs above,
304+
provided for backwards compatibility.
305+
306+
.. versionchanged:: 3.4
307+
308+
The macros are now aliases of the corresponding mixed-case names.
309+
Previously, their of the macros was the same, but their use did
310+
not preserve binary compatibility across Python versions.
311+
312+
.. deprecated:: 2.0
307313
308314
309315
.. _objectinterface:

0 commit comments

Comments
 (0)