Skip to content

Commit 7794219

Browse files
Merge branch 'main' into argparse-help-color
2 parents 682321f + fa1ac90 commit 7794219

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+405
-167
lines changed

Doc/deprecations/c-api-pending-removal-in-3.20.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Pending removal in Python 3.20
22
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33

4+
* :c:func:`!_PyObject_CallMethodId`, :c:func:`!_PyObject_GetAttrId` and
5+
:c:func:`!_PyUnicode_FromId` are deprecated since 3.15 and will be removed in
6+
3.20. Instead, use :c:func:`PyUnicode_FromString()` and cache the result in
7+
the module state, then call :c:func:`PyObject_CallMethod` or
8+
:c:func:`PyObject_GetAttr`.
9+
(Contributed by Victor Stinner in :gh:`141049`.)
10+
411
* The ``cval`` field in :c:type:`PyComplexObject` (:gh:`128813`).
512
Use :c:func:`PyComplex_AsCComplex` and :c:func:`PyComplex_FromCComplex`
613
to convert a Python complex number to/from the C :c:type:`Py_complex`

Doc/library/typing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2869,8 +2869,8 @@ ABCs and Protocols for working with I/O
28692869
---------------------------------------
28702870

28712871
.. class:: IO[AnyStr]
2872-
TextIO[AnyStr]
2873-
BinaryIO[AnyStr]
2872+
TextIO
2873+
BinaryIO
28742874

28752875
Generic class ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])``
28762876
and ``BinaryIO(IO[bytes])``

Doc/whatsnew/3.15.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,13 @@ Deprecated C APIs
12141214
use the :c:type:`PyBytesWriter` API instead.
12151215
(Contributed by Victor Stinner in :gh:`129813`.)
12161216

1217+
* :c:func:`!_PyObject_CallMethodId`, :c:func:`!_PyObject_GetAttrId` and
1218+
:c:func:`!_PyUnicode_FromId` are deprecated since 3.15 and will be removed in
1219+
3.20. Instead, use :c:func:`PyUnicode_FromString()` and cache the result in
1220+
the module state, then call :c:func:`PyObject_CallMethod` or
1221+
:c:func:`PyObject_GetAttr`.
1222+
(Contributed by Victor Stinner in :gh:`141049`.)
1223+
12171224
* Deprecate :c:member:`~PyComplexObject.cval` field of the
12181225
:c:type:`PyComplexObject` type.
12191226
Use :c:func:`PyComplex_AsCComplex` and :c:func:`PyComplex_FromCComplex`

Include/cpython/abstract.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
88
as the method name. */
9-
PyAPI_FUNC(PyObject*) _PyObject_CallMethodId(
9+
Py_DEPRECATED(3.15) PyAPI_FUNC(PyObject*) _PyObject_CallMethodId(
1010
PyObject *obj,
1111
_Py_Identifier *name,
1212
const char *format, ...);

Include/cpython/object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ PyAPI_FUNC(void) PyUnstable_Object_Dump(PyObject *);
300300
// Alias for backward compatibility
301301
#define _PyObject_Dump PyUnstable_Object_Dump
302302

303-
PyAPI_FUNC(PyObject*) _PyObject_GetAttrId(PyObject *, _Py_Identifier *);
303+
Py_DEPRECATED(3.15) PyAPI_FUNC(PyObject*) _PyObject_GetAttrId(PyObject *, _Py_Identifier *);
304304

305305
PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);
306306
PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *);

Include/cpython/unicodeobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,4 +778,4 @@ static inline int Py_UNICODE_ISALNUM(Py_UCS4 ch) {
778778

779779
// Return an interned Unicode object for an Identifier; may fail if there is no
780780
// memory.
781-
PyAPI_FUNC(PyObject*) _PyUnicode_FromId(_Py_Identifier*);
781+
Py_DEPRECATED(3.15) PyAPI_FUNC(PyObject*) _PyUnicode_FromId(_Py_Identifier*);

Include/internal/pycore_opcode_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_ids.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_metadata.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

InternalDocs/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ Runtime Objects
2929

3030
- [Frames](frames.md)
3131

32-
- [String Interning](string_interning.md)
33-
3432
Program Execution
3533
---
3634

@@ -48,6 +46,14 @@ Program Execution
4846

4947
- [Stack protection](stack_protection.md)
5048

49+
Built-in Types
50+
---
51+
52+
- [String Interning](string_interning.md)
53+
54+
- [List sort algorithm](../Objects/listsort.txt)
55+
<!-- (kept at the original location outside this directory) -->
56+
5157
Modules
5258
---
5359

0 commit comments

Comments
 (0)