Skip to content

Commit 1041065

Browse files
authored
Merge branch 'main' into gh-121045
2 parents 28ff299 + f8a736b commit 1041065

File tree

159 files changed

+4791
-1927
lines changed

Some content is hidden

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

159 files changed

+4791
-1927
lines changed

Doc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ dist:
217217
# as otherwise the full latexmk process is run twice.
218218
# ($$ is needed to escape the $; https://www.gnu.org/software/make/manual/make.html#Basics-of-Variable-References)
219219
-sed -i 's/: all-$$(FMT)/:/' build/latex/Makefile
220-
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
220+
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
221221
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-a4.zip
222222
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2
223223
@echo "Build finished and archived!"
@@ -227,7 +227,7 @@ dist:
227227
rm -rf build/latex
228228
$(MAKE) latex PAPER=letter
229229
-sed -i 's/: all-$$(FMT)/:/' build/latex/Makefile
230-
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
230+
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
231231
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip
232232
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2
233233
@echo "Build finished and archived!"

Doc/c-api/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ Initializing and finalizing the interpreter
426426
loaded extension modules loaded by Python are not unloaded. Small amounts of
427427
memory allocated by the Python interpreter may not be freed (if you find a leak,
428428
please report it). Memory tied up in circular references between objects is not
429-
freed. Interned strings will all be deallocated regarldess of their reference count.
429+
freed. Interned strings will all be deallocated regardless of their reference count.
430430
Some memory allocated by extension modules may not be freed. Some extensions may not
431431
work properly if their initialization routine is called more than once; this can
432432
happen if an application calls :c:func:`Py_Initialize` and :c:func:`Py_FinalizeEx`

Doc/c-api/long.rst

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,32 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
6969
on failure.
7070
7171
72+
.. c:function:: PyObject* PyLong_FromInt32(int32_t value)
73+
PyObject* PyLong_FromInt64(int64_t value)
74+
75+
Return a new :c:type:`PyLongObject` object from a signed C
76+
:c:expr:`int32_t` or :c:expr:`int64_t`, or ``NULL``
77+
with an exception set on failure.
78+
79+
.. versionadded:: 3.14
80+
81+
7282
.. c:function:: PyObject* PyLong_FromUnsignedLongLong(unsigned long long v)
7383
7484
Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long long`,
7585
or ``NULL`` on failure.
7686
7787
88+
.. c:function:: PyObject* PyLong_FromUInt32(uint32_t value)
89+
PyObject* PyLong_FromUInt64(uint64_t value)
90+
91+
Return a new :c:type:`PyLongObject` object from an unsigned C
92+
:c:expr:`uint32_t` or :c:expr:`uint64_t`, or ``NULL``
93+
with an exception set on failure.
94+
95+
.. versionadded:: 3.14
96+
97+
7898
.. c:function:: PyObject* PyLong_FromDouble(double v)
7999
80100
Return a new :c:type:`PyLongObject` object from the integer part of *v*, or
@@ -337,6 +357,43 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
337357
This function will no longer use :meth:`~object.__int__`.
338358
339359
360+
.. c:function:: int PyLong_AsInt32(PyObject *obj, int32_t *value)
361+
int PyLong_AsInt64(PyObject *obj, int64_t *value)
362+
363+
Set *\*value* to a signed C :c:expr:`int32_t` or :c:expr:`int64_t`
364+
representation of *obj*.
365+
366+
If the *obj* value is out of range, raise an :exc:`OverflowError`.
367+
368+
Set *\*value* and return ``0`` on success.
369+
Set an exception and return ``-1`` on error.
370+
371+
*value* must not be ``NULL``.
372+
373+
.. versionadded:: 3.14
374+
375+
376+
.. c:function:: int PyLong_AsUInt32(PyObject *obj, uint32_t *value)
377+
int PyLong_AsUInt64(PyObject *obj, uint64_t *value)
378+
379+
Set *\*value* to an unsigned C :c:expr:`uint32_t` or :c:expr:`uint64_t`
380+
representation of *obj*.
381+
382+
If *obj* is not an instance of :c:type:`PyLongObject`, first call its
383+
:meth:`~object.__index__` method (if present) to convert it to a
384+
:c:type:`PyLongObject`.
385+
386+
* If *obj* is negative, raise a :exc:`ValueError`.
387+
* If the *obj* value is out of range, raise an :exc:`OverflowError`.
388+
389+
Set *\*value* and return ``0`` on success.
390+
Set an exception and return ``-1`` on error.
391+
392+
*value* must not be ``NULL``.
393+
394+
.. versionadded:: 3.14
395+
396+
340397
.. c:function:: double PyLong_AsDouble(PyObject *pylong)
341398
342399
Return a C :c:expr:`double` representation of *pylong*. *pylong* must be

Doc/c-api/tuple.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,27 @@ Tuple Objects
3333
3434
.. c:function:: PyObject* PyTuple_New(Py_ssize_t len)
3535
36-
Return a new tuple object of size *len*, or ``NULL`` on failure.
36+
Return a new tuple object of size *len*,
37+
or ``NULL`` with an exception set on failure.
3738
3839
3940
.. c:function:: PyObject* PyTuple_Pack(Py_ssize_t n, ...)
4041
41-
Return a new tuple object of size *n*, or ``NULL`` on failure. The tuple values
42+
Return a new tuple object of size *n*,
43+
or ``NULL`` with an exception set on failure. The tuple values
4244
are initialized to the subsequent *n* C arguments pointing to Python objects.
4345
``PyTuple_Pack(2, a, b)`` is equivalent to ``Py_BuildValue("(OO)", a, b)``.
4446
4547
4648
.. c:function:: Py_ssize_t PyTuple_Size(PyObject *p)
4749
4850
Take a pointer to a tuple object, and return the size of that tuple.
51+
On error, return ``-1`` and with an exception set.
4952
5053
5154
.. c:function:: Py_ssize_t PyTuple_GET_SIZE(PyObject *p)
5255
53-
Return the size of the tuple *p*, which must be non-``NULL`` and point to a tuple;
54-
no error checking is performed.
56+
Like :c:func:`PyTuple_Size`, but without error checking.
5557
5658
5759
.. c:function:: PyObject* PyTuple_GetItem(PyObject *p, Py_ssize_t pos)
@@ -74,8 +76,10 @@ Tuple Objects
7476
.. c:function:: PyObject* PyTuple_GetSlice(PyObject *p, Py_ssize_t low, Py_ssize_t high)
7577
7678
Return the slice of the tuple pointed to by *p* between *low* and *high*,
77-
or ``NULL`` on failure. This is the equivalent of the Python expression
78-
``p[low:high]``. Indexing from the end of the tuple is not supported.
79+
or ``NULL`` with an exception set on failure.
80+
81+
This is the equivalent of the Python expression ``p[low:high]``.
82+
Indexing from the end of the tuple is not supported.
7983
8084
8185
.. c:function:: int PyTuple_SetItem(PyObject *p, Py_ssize_t pos, PyObject *o)
@@ -141,6 +145,8 @@ type.
141145
Create a new struct sequence type from the data in *desc*, described below. Instances
142146
of the resulting type can be created with :c:func:`PyStructSequence_New`.
143147
148+
Return ``NULL`` with an exception set on failure.
149+
144150
145151
.. c:function:: void PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc)
146152
@@ -149,8 +155,8 @@ type.
149155
150156
.. c:function:: int PyStructSequence_InitType2(PyTypeObject *type, PyStructSequence_Desc *desc)
151157
152-
The same as ``PyStructSequence_InitType``, but returns ``0`` on success and ``-1`` on
153-
failure.
158+
Like :c:func:`PyStructSequence_InitType`, but returns ``0`` on success
159+
and ``-1`` with an exception set on failure.
154160
155161
.. versionadded:: 3.4
156162
@@ -207,6 +213,8 @@ type.
207213
Creates an instance of *type*, which must have been created with
208214
:c:func:`PyStructSequence_NewType`.
209215
216+
Return ``NULL`` with an exception set on failure.
217+
210218
211219
.. c:function:: PyObject* PyStructSequence_GetItem(PyObject *p, Py_ssize_t pos)
212220

Doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
('c:type', 'size_t'),
142142
('c:type', 'ssize_t'),
143143
('c:type', 'time_t'),
144+
('c:type', 'uint32_t'),
144145
('c:type', 'uint64_t'),
145146
('c:type', 'uintmax_t'),
146147
('c:type', 'uintptr_t'),

Doc/data/stable_abi.dat

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

Doc/deprecations/pending-removal-in-3.16.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Pending Removal in Python 3.16
55
:class:`array.array` ``'u'`` type (:c:type:`wchar_t`):
66
use the ``'w'`` type instead (``Py_UCS4``).
77

8+
* :mod:`builtins`:
9+
``~bool``, bitwise inversion on bool.
10+
811
* :mod:`symtable`:
912
Deprecate :meth:`symtable.Class.get_methods` due to the lack of interest.
1013
(Contributed by Bénédikt Tran in :gh:`119698`.)

Doc/deprecations/pending-removal-in-future.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ although there is currently no date scheduled for their removal.
1111

1212
* :mod:`builtins`:
1313

14-
* ``~bool``, bitwise inversion on bool.
1514
* ``bool(NotImplemented)``.
1615
* Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)``
1716
signature is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead,

Doc/glossary.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -590,14 +590,12 @@ Glossary
590590
which ships with the standard distribution of Python.
591591

592592
immortal
593-
If an object is immortal, its reference count is never modified, and
594-
therefore it is never deallocated.
593+
*Immortal objects* are a CPython implementation detail introduced
594+
in :pep:`683`.
595595

596-
Built-in strings and singletons are immortal objects. For example,
597-
:const:`True` and :const:`None` singletons are immortal.
598-
599-
See `PEP 683 – Immortal Objects, Using a Fixed Refcount
600-
<https://peps.python.org/pep-0683/>`_ for more information.
596+
If an object is immortal, its :term:`reference count` is never modified,
597+
and therefore it is never deallocated while the interpreter is running.
598+
For example, :const:`True` and :const:`None` are immortal in CPython.
601599

602600
immutable
603601
An object with a fixed value. Immutable objects include numbers, strings and

Doc/library/functions.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,6 +1700,13 @@ are always available. They are listed here in alphabetical order.
17001700
.. versionchanged:: 3.5
17011701
The docstrings of property objects are now writeable.
17021702

1703+
.. attribute:: __name__
1704+
1705+
Attribute holding the name of the property. The name of the property
1706+
can be changed at runtime.
1707+
1708+
.. versionadded:: 3.13
1709+
17031710

17041711
.. _func-range:
17051712
.. class:: range(stop)

0 commit comments

Comments
 (0)