Skip to content

Commit ff95879

Browse files
author
Erlend E. Aasland
committed
Merge remote-tracking branch 'upstream/main' into ac-tkinter
2 parents 72cf592 + ca9689f commit ff95879

File tree

90 files changed

+1386
-1104
lines changed

Some content is hidden

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

90 files changed

+1386
-1104
lines changed

.github/CODEOWNERS

+8-16
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ Python/traceback.c @iritkatriel
3232
Python/pythonrun.c @iritkatriel
3333

3434
# Hashing
35-
**/*hashlib* @python/crypto-team @tiran
36-
**/*pyhash* @python/crypto-team @tiran
37-
**/*sha* @python/crypto-team @tiran
38-
**/*md5* @python/crypto-team @tiran
39-
**/*blake* @python/crypto-team @tiran
40-
/Modules/_blake2/** @python/crypto-team @tiran
41-
/Modules/_sha3/** @python/crypto-team @tiran
35+
**/*hashlib* @tiran
36+
**/*pyhash* @tiran
37+
**/*sha* @tiran
38+
**/*md5* @tiran
39+
**/*blake* @tiran
40+
/Modules/_blake2/** @tiran
41+
/Modules/_sha3/** @tiran
4242

4343
# logging
4444
**/*logging* @vsajip
@@ -61,14 +61,6 @@ Python/pythonrun.c @iritkatriel
6161
**/*import*.c @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
6262
**/*import*.py @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
6363

64-
65-
# SSL
66-
**/*ssl* @python/crypto-team
67-
**/*.pem @python/crypto-team
68-
69-
# CSPRNG
70-
Python/bootstrap_hash.c @python/crypto-team
71-
7264
# Dates and times
7365
**/*datetime* @pganssle @abalkin
7466
**/*str*time* @pganssle @abalkin
@@ -132,7 +124,7 @@ Lib/ast.py @isidentical
132124
**/*bisect* @rhettinger
133125
**/*heapq* @rhettinger
134126
**/*functools* @rhettinger
135-
**/*decimal* @rhettinger @skrah
127+
**/*decimal* @rhettinger
136128

137129
**/*dataclasses* @ericvsmith
138130

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Mac/pythonw
7575
Misc/python.pc
7676
Misc/python-embed.pc
7777
Misc/python-config.sh
78+
Modules/Setup.bootstrap
7879
Modules/Setup.config
7980
Modules/Setup.local
8081
Modules/Setup.stdlib

Doc/library/dis.rst

+10-1
Original file line numberDiff line numberDiff line change
@@ -475,15 +475,24 @@ the original TOS1.
475475

476476
**Coroutine opcodes**
477477

478-
.. opcode:: GET_AWAITABLE
478+
.. opcode:: GET_AWAITABLE (where)
479479

480480
Implements ``TOS = get_awaitable(TOS)``, where ``get_awaitable(o)``
481481
returns ``o`` if ``o`` is a coroutine object or a generator object with
482482
the CO_ITERABLE_COROUTINE flag, or resolves
483483
``o.__await__``.
484484

485+
If the ``where`` operand is nonzero, it indicates where the instruction
486+
occurs:
487+
488+
* ``1`` After a call to ``__aenter__``
489+
* ``2`` After a call to ``__aexit__``
490+
485491
.. versionadded:: 3.5
486492

493+
.. versionchanged:: 3.11
494+
Previously, this instruction did not have an oparg.
495+
487496

488497
.. opcode:: GET_AITER
489498

Doc/library/io.rst

+4-7
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,7 @@ I/O Base Classes
306306

307307
.. class:: IOBase
308308

309-
The abstract base class for all I/O classes, acting on streams of bytes.
310-
There is no public constructor.
309+
The abstract base class for all I/O classes.
311310

312311
This class provides empty abstract implementations for many methods
313312
that derived classes can override selectively; the default
@@ -461,8 +460,7 @@ I/O Base Classes
461460

462461
.. class:: RawIOBase
463462

464-
Base class for raw binary streams. It inherits :class:`IOBase`. There is no
465-
public constructor.
463+
Base class for raw binary streams. It inherits :class:`IOBase`.
466464

467465
Raw binary streams typically provide low-level access to an underlying OS
468466
device or API, and do not try to encapsulate it in high-level primitives
@@ -515,7 +513,7 @@ I/O Base Classes
515513
.. class:: BufferedIOBase
516514

517515
Base class for binary streams that support some kind of buffering.
518-
It inherits :class:`IOBase`. There is no public constructor.
516+
It inherits :class:`IOBase`.
519517

520518
The main difference with :class:`RawIOBase` is that methods :meth:`read`,
521519
:meth:`readinto` and :meth:`write` will try (respectively) to read as much
@@ -852,8 +850,7 @@ Text I/O
852850
.. class:: TextIOBase
853851

854852
Base class for text streams. This class provides a character and line based
855-
interface to stream I/O. It inherits :class:`IOBase`. There is no public
856-
constructor.
853+
interface to stream I/O. It inherits :class:`IOBase`.
857854

858855
:class:`TextIOBase` provides or overrides these data attributes and
859856
methods in addition to those from :class:`IOBase`:

Doc/library/sys.rst

+3-5
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,7 @@ always available.
449449

450450
.. function:: exit([arg])
451451

452-
Exit from Python. This is implemented by raising the :exc:`SystemExit`
453-
exception, so cleanup actions specified by finally clauses of :keyword:`try`
454-
statements are honored, and it is possible to intercept the exit attempt at
455-
an outer level.
452+
Raise a :exc:`SystemExit` exception, signaling an intention to exit the interpreter.
456453

457454
The optional argument *arg* can be an integer giving the exit status
458455
(defaulting to zero), or another type of object. If it is an integer, zero
@@ -469,7 +466,8 @@ always available.
469466

470467
Since :func:`exit` ultimately "only" raises an exception, it will only exit
471468
the process when called from the main thread, and the exception is not
472-
intercepted.
469+
intercepted. Cleanup actions specified by finally clauses of :keyword:`try` statements
470+
are honored, and it is possible to intercept the exit attempt at an outer level.
473471

474472
.. versionchanged:: 3.6
475473
If an error occurs in the cleanup after the Python interpreter

Doc/library/threading.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ since it is impossible to detect the termination of alien threads.
441441

442442
.. attribute:: daemon
443443

444-
A boolean value indicating whether this thread is a daemon thread (True)
445-
or not (False). This must be set before :meth:`~Thread.start` is called,
444+
A boolean value indicating whether this thread is a daemon thread (``True``)
445+
or not (``False``). This must be set before :meth:`~Thread.start` is called,
446446
otherwise :exc:`RuntimeError` is raised. Its initial value is inherited
447447
from the creating thread; the main thread is not a daemon thread and
448448
therefore all threads created in the main thread default to
@@ -516,7 +516,7 @@ All methods are executed atomically.
516516
value, block for at most the number of seconds specified by *timeout*
517517
and as long as the lock cannot be acquired. A *timeout* argument of ``-1``
518518
specifies an unbounded wait. It is forbidden to specify a *timeout*
519-
when *blocking* is false.
519+
when *blocking* is ``False``.
520520

521521
The return value is ``True`` if the lock is acquired successfully,
522522
``False`` if not (for example if the *timeout* expired).
@@ -544,7 +544,7 @@ All methods are executed atomically.
544544

545545
.. method:: locked()
546546

547-
Return true if the lock is acquired.
547+
Return ``True`` if the lock is acquired.
548548

549549

550550

@@ -593,17 +593,17 @@ Reentrant locks also support the :ref:`context management protocol <with-locks>`
593593
is unlocked, only one at a time will be able to grab ownership of the lock.
594594
There is no return value in this case.
595595

596-
When invoked with the *blocking* argument set to true, do the same thing as when
596+
When invoked with the *blocking* argument set to ``True``, do the same thing as when
597597
called without arguments, and return ``True``.
598598

599-
When invoked with the *blocking* argument set to false, do not block. If a call
599+
When invoked with the *blocking* argument set to ``False``, do not block. If a call
600600
without an argument would block, return ``False`` immediately; otherwise, do the
601601
same thing as when called without arguments, and return ``True``.
602602

603603
When invoked with the floating-point *timeout* argument set to a positive
604604
value, block for at most the number of seconds specified by *timeout*
605605
and as long as the lock cannot be acquired. Return ``True`` if the lock has
606-
been acquired, false if the timeout has elapsed.
606+
been acquired, ``False`` if the timeout has elapsed.
607607

608608
.. versionchanged:: 3.2
609609
The *timeout* parameter is new.
@@ -844,7 +844,7 @@ Semaphores also support the :ref:`context management protocol <with-locks>`.
844844
thread will be awoken by each call to :meth:`~Semaphore.release`. The
845845
order in which threads are awoken should not be relied on.
846846

847-
When invoked with *blocking* set to false, do not block. If a call
847+
When invoked with *blocking* set to ``False``, do not block. If a call
848848
without an argument would block, return ``False`` immediately; otherwise, do
849849
the same thing as when called without arguments, and return ``True``.
850850

Doc/whatsnew/3.11.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ Porting to Python 3.11
909909
#endif
910910

911911
Or use the `pythoncapi_compat project
912-
<https://github.com/pythoncapi/pythoncapi_compat>`__ to get these two
912+
<https://github.com/python/pythoncapi_compat>`__ to get these two
913913
functions on older Python versions.
914914

915915
* Changes of the :c:type:`PyThreadState` structure members:
@@ -962,7 +962,7 @@ Porting to Python 3.11
962962
#endif
963963

964964
Or use `the pythoncapi_compat project
965-
<https://github.com/pythoncapi/pythoncapi_compat>`__ to get these functions
965+
<https://github.com/python/pythoncapi_compat>`__ to get these functions
966966
on old Python functions.
967967

968968

@@ -985,6 +985,9 @@ Deprecated
985985
<init-config>` instead (:pep:`587`).
986986
(Contributed by Victor Stinner in :issue:`44113`.)
987987

988+
* Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:func:`PyObject_Hash` instead.
989+
(Contributed by Inada Naoki in :issue:`46864`.)
990+
988991
Removed
989992
-------
990993

Include/cpython/bytesobject.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
typedef struct {
66
PyObject_VAR_HEAD
7-
Py_hash_t ob_shash;
7+
Py_DEPRECATED(3.11) Py_hash_t ob_shash;
88
char ob_sval[1];
99

1010
/* Invariants:

0 commit comments

Comments
 (0)