Skip to content

Commit 4933e56

Browse files
authored
Merge branch 'main' into imaginary-class-109218
2 parents 14dab20 + 133e929 commit 4933e56

File tree

190 files changed

+3466
-1871
lines changed

Some content is hidden

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

190 files changed

+3466
-1871
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 24 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"build": {
3-
"dockerfile": "Dockerfile"
4-
},
2+
"image": "ghcr.io/python/devcontainer:2024.09.25.11038928730",
53
"onCreateCommand": [
64
// Install common tooling.
75
"dnf",

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ Doc/c-api/stable.rst @encukou
207207
**/*bisect* @rhettinger
208208
**/*heapq* @rhettinger
209209
**/*functools* @rhettinger
210-
**/*decimal* @rhettinger
211210

212211
**/*dataclasses* @ericvsmith
213212

Doc/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,12 @@ serve:
306306
# for development releases: always build
307307
.PHONY: autobuild-dev
308308
autobuild-dev:
309-
$(MAKE) dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
309+
$(MAKE) dist-no-html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
310310

311-
# for quick rebuilds (HTML only)
311+
# for HTML-only rebuilds
312312
.PHONY: autobuild-dev-html
313313
autobuild-dev-html:
314-
$(MAKE) html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
314+
$(MAKE) dist-html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
315315

316316
# for stable releases: only build if not in pre-release stage (alpha, beta)
317317
# release candidate downloads are okay, since the stable tree can be in that stage

Doc/c-api/init_config.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,19 +1248,24 @@ PyConfig
12481248
12491249
.. c:member:: int perf_profiling
12501250
1251-
Enable compatibility mode with the perf profiler?
1251+
Enable the Linux ``perf`` profiler support?
12521252
1253-
If non-zero, initialize the perf trampoline. See :ref:`perf_profiling`
1254-
for more information.
1253+
If equals to ``1``, enable support for the Linux ``perf`` profiler.
12551254
1256-
Set by :option:`-X perf <-X>` command-line option and by the
1257-
:envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable for perf support
1258-
with stack pointers and :option:`-X perf_jit <-X>` command-line option
1259-
and by the :envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable for perf
1260-
support with DWARF JIT information.
1255+
If equals to ``2``, enable support for the Linux ``perf`` profiler with
1256+
DWARF JIT support.
1257+
1258+
Set to ``1`` by :option:`-X perf <-X>` command-line option and the
1259+
:envvar:`PYTHONPERFSUPPORT` environment variable.
1260+
1261+
Set to ``2`` by the :option:`-X perf_jit <-X>` command-line option and
1262+
the :envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable.
12611263
12621264
Default: ``-1``.
12631265
1266+
.. seealso::
1267+
See :ref:`perf_profiling` for more information.
1268+
12641269
.. versionadded:: 3.12
12651270
12661271
.. c:member:: int use_environment

Doc/c-api/long.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
159159
.. versionadded:: 3.13
160160
161161
162-
.. XXX alias PyLong_AS_LONG (for now)
163162
.. c:function:: long PyLong_AsLong(PyObject *obj)
164163
165164
.. index::
@@ -181,6 +180,16 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
181180
.. versionchanged:: 3.10
182181
This function will no longer use :meth:`~object.__int__`.
183182
183+
.. c:namespace:: NULL
184+
185+
.. c:function:: long PyLong_AS_LONG(PyObject *obj)
186+
187+
A :term:`soft deprecated` alias.
188+
Exactly equivalent to the preferred ``PyLong_AsLong``. In particular,
189+
it can fail with :exc:`OverflowError` or another exception.
190+
191+
.. deprecated:: 3.14
192+
The function is soft deprecated.
184193
185194
.. c:function:: int PyLong_AsInt(PyObject *obj)
186195

Doc/c-api/unicode.rst

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ These APIs can be used to work with surrogates:
317317
318318
.. c:function:: Py_UCS4 Py_UNICODE_JOIN_SURROGATES(Py_UCS4 high, Py_UCS4 low)
319319
320-
Join two surrogate characters and return a single :c:type:`Py_UCS4` value.
320+
Join two surrogate code points and return a single :c:type:`Py_UCS4` value.
321321
*high* and *low* are respectively the leading and trailing surrogates in a
322322
surrogate pair. *high* must be in the range [0xD800; 0xDBFF] and *low* must
323323
be in the range [0xDC00; 0xDFFF].
@@ -338,6 +338,8 @@ APIs:
338338
This is the recommended way to allocate a new Unicode object. Objects
339339
created using this function are not resizable.
340340
341+
On error, set an exception and return ``NULL``.
342+
341343
.. versionadded:: 3.3
342344
343345
@@ -614,6 +616,8 @@ APIs:
614616
615617
Return the length of the Unicode object, in code points.
616618
619+
On error, set an exception and return ``-1``.
620+
617621
.. versionadded:: 3.3
618622
619623
@@ -657,6 +661,8 @@ APIs:
657661
not out of bounds, and that the object can be modified safely (i.e. that it
658662
its reference count is one).
659663
664+
Return ``0`` on success, ``-1`` on error with an exception set.
665+
660666
.. versionadded:: 3.3
661667
662668
@@ -666,6 +672,8 @@ APIs:
666672
Unicode object and the index is not out of bounds, in contrast to
667673
:c:func:`PyUnicode_READ_CHAR`, which performs no error checking.
668674
675+
Return character on success, ``-1`` on error with an exception set.
676+
669677
.. versionadded:: 3.3
670678
671679
@@ -674,6 +682,7 @@ APIs:
674682
675683
Return a substring of *unicode*, from character index *start* (included) to
676684
character index *end* (excluded). Negative indices are not supported.
685+
On error, set an exception and return ``NULL``.
677686
678687
.. versionadded:: 3.3
679688
@@ -990,6 +999,9 @@ These are the UTF-8 codec APIs:
990999
object. Error handling is "strict". Return ``NULL`` if an exception was
9911000
raised by the codec.
9921001
1002+
The function fails if the string contains surrogate code points
1003+
(``U+D800`` - ``U+DFFF``).
1004+
9931005
9941006
.. c:function:: const char* PyUnicode_AsUTF8AndSize(PyObject *unicode, Py_ssize_t *size)
9951007
@@ -1002,6 +1014,9 @@ These are the UTF-8 codec APIs:
10021014
On error, set an exception, set *size* to ``-1`` (if it's not NULL) and
10031015
return ``NULL``.
10041016
1017+
The function fails if the string contains surrogate code points
1018+
(``U+D800`` - ``U+DFFF``).
1019+
10051020
This caches the UTF-8 representation of the string in the Unicode object, and
10061021
subsequent calls will return a pointer to the same buffer. The caller is not
10071022
responsible for deallocating the buffer. The buffer is deallocated and
@@ -1429,8 +1444,9 @@ They all return ``NULL`` or ``-1`` if an exception occurs.
14291444
Compare a Unicode object with a char buffer which is interpreted as
14301445
being UTF-8 or ASCII encoded and return true (``1``) if they are equal,
14311446
or false (``0``) otherwise.
1432-
If the Unicode object contains surrogate characters or
1433-
the C string is not valid UTF-8, false (``0``) is returned.
1447+
If the Unicode object contains surrogate code points
1448+
(``U+D800`` - ``U+DFFF``) or the C string is not valid UTF-8,
1449+
false (``0``) is returned.
14341450
14351451
This function does not raise exceptions.
14361452

Doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@
413413
\let\endVerbatim=\endOriginalVerbatim
414414
\setcounter{tocdepth}{2}
415415
''',
416-
# The paper size ('letter' or 'a4').
417-
'papersize': 'a4',
416+
# The paper size ('letterpaper' or 'a4paper').
417+
'papersize': 'a4paper',
418418
# The font size ('10pt', '11pt' or '12pt').
419419
'pointsize': '10pt',
420420
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ Pending Removal in Python 3.16
1818
Use the ``'w'`` format code (:c:type:`Py_UCS4`)
1919
for Unicode characters instead.
2020

21+
* :mod:`asyncio`:
22+
23+
* :mod:`asyncio`:
24+
:func:`!asyncio.iscoroutinefunction` is deprecated
25+
and will be removed in Python 3.16,
26+
use :func:`inspect.iscoroutinefunction` instead.
27+
(Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)
28+
2129
* :mod:`shutil`:
2230

2331
* The :class:`!ExecError` exception

Doc/faq/programming.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,9 +1613,16 @@ method too, and it must do so carefully. The basic implementation of
16131613
self.__dict__[name] = value
16141614
...
16151615

1616-
Most :meth:`!__setattr__` implementations must modify
1617-
:attr:`self.__dict__ <object.__dict__>` to store
1618-
local state for self without causing an infinite recursion.
1616+
Many :meth:`~object.__setattr__` implementations call :meth:`!object.__setattr__` to set
1617+
an attribute on self without causing infinite recursion::
1618+
1619+
class X:
1620+
def __setattr__(self, name, value):
1621+
# Custom logic here...
1622+
object.__setattr__(self, name, value)
1623+
1624+
Alternatively, it is possible to set attributes by inserting
1625+
entries into :attr:`self.__dict__ <object.__dict__>` directly.
16191626

16201627

16211628
How do I call a method defined in a base class from a derived class that extends it?

0 commit comments

Comments
 (0)