8000 Merge branch 'main' into gh-111926-simplify-weakref-creation · python/cpython@ac0e684 · GitHub
[go: up one dir, main page]

Skip to content

Commit ac0e684

Browse files
committed
Merge branch 'main' into gh-111926-simplify-weakref-creation
2 parents e7dda6b + 5f52d20 commit ac0e684

37 files changed

+1564
-1233
lines changed

Doc/c-api/type.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,21 @@ Type Objects
185185
186186
.. versionadded:: 3.11
187187
188+
.. c:function:: PyObject* PyType_GetFullyQualifiedName(PyTypeObject *type)
189+
190+
Return the type's fully qualified name. Equivalent to
191+
``f"{type.__module__}.{type.__qualname__}"``, or ``type.__qualname__`` if
192+
``type.__module__`` is not a string or is equal to ``"builtins"``.
193+
194+
.. versionadded:: 3.13
195+
196+
.. c:function:: PyObject* PyType_GetModuleName(PyTypeObject *type)
197+
198+
Return the type's module name. Equivalent to getting the ``type.__module__``
199+
attribute.
200+
201+
.. versionadded:: 3.13
202+
188203
.. c:function:: void* PyType_GetSlot(PyTypeObject *type, int slot)
189204
190205
Return the function pointer stored in the given slot. If the

Doc/data/stable_abi.dat

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

Doc/library/itertools.rst

Lines changed: 94 additions & 84 deletions
Large diffs are not rendered by default.

Doc/whatsnew/3.13.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,6 +1658,16 @@ New Features
16581658
between native integer types and Python :class:`int` objects.
16591659
(Contributed by Steve Dower in :gh:`111140`.)
16601660

1661+
* Add :c:func:`PyType_GetFullyQualifiedName` function to get the type's fully
1662+
qualified name. Equivalent to ``f"{type.__module__}.{type.__qualname__}"``,
1663+
or ``type.__qualname__`` if ``type.__module__`` is not a string or is equal
1664+
to ``"builtins"``.
1665+
(Contributed by Victor Stinner in :gh:`111696`.)
1666+
1667+
* Add :c:func:`PyType_GetModuleName` function to get the type's module name.
1668+
Equivalent to getting the ``type.__module__`` attribute.
1669+
(Contributed by Eric Snow and Victor Stinner in :gh:`111696`.)
1670+
16611671

16621672
Porting to Python 3.13
16631673
----------------------

Include/internal/pycore_opcode_metadata.h

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

Include/internal/pycore_typeobject.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,6 @@ PyAPI_FUNC(PyObject*) _PySuper_Lookup(PyTypeObject *su_type, PyObject *su_obj,
151151
PyObject *name, int *meth_found);
152152

153153

154-
// This is exported for the _testinternalcapi module.
155-
PyAPI_FUNC(PyObject *) _PyType_GetModuleName(PyTypeObject *);
156-
157-
158154
#ifdef __cplusplus
159155
}
160156
#endif

0 commit comments

Comments
 (0)
0