Skip to content

Commit 791c418

Browse files
authored
Merge branch 'main' into zac/fix-hypothesis-ci-caching
2 parents abd6b24 + 8186500 commit 791c418

File tree

96 files changed

+2199
-926
lines changed

Some content is hidden

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

96 files changed

+2199
-926
lines changed

Doc/c-api/module.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,14 @@ The available slot types are:
427427
This slot is ignored by Python builds not configured with
428428
:option:`--disable-gil`. Otherwise, it determines whether or not importing
429429
this module will cause the GIL to be automatically enabled. See
430-
:envvar:`PYTHON_GIL` and :option:`-X gil <-X>` for more detail.
430+
:ref:`free-threaded-cpython` for more detail.
431431
432432
Multiple ``Py_mod_gil`` slots may not be specified in one module definition.
433433
434434
If ``Py_mod_gil`` is not specified, the import machinery defaults to
435435
``Py_MOD_GIL_USED``.
436436
437-
.. versionadded: 3.13
437+
.. versionadded:: 3.13
438438
439439
See :PEP:`489` for more details on multi-phase initialization.
440440

Doc/c-api/monitoring.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ See :mod:`sys.monitoring` for descriptions of the events.
121121
:c:func:`PyErr_GetRaisedException`).
122122
123123
124-
.. c:function:: int PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset)
124+
.. c:function:: int PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, PyObject *value)
125125
126-
Fire a ``STOP_ITERATION`` event with the current exception (as returned by
127-
:c:func:`PyErr_GetRaisedException`).
126+
Fire a ``STOP_ITERATION`` event. If ``value`` is an instance of :exc:`StopIteration`, it is used. Otherwise,
127+
a new :exc:`StopIteration` instance is created with ``value`` as its argument.
128128
129129
130130
Managing the Monitoring State

Doc/library/ast.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,6 +2472,20 @@ effects on the compilation of a program:
24722472
.. versionadded:: 3.8
24732473

24742474

2475+
.. function:: compare(a, b, /, *, compare_attributes=False)
2476+
2477+
Recursively compares two ASTs.
2478+
2479+
*compare_attributes* affects whether AST attributes are considered
2480+
in the comparison. If *compare_attributes* is ``False`` (default), then
2481+
attributes are ignored. Otherwise they must all be equal. This
2482+
option is useful to check whether the ASTs are structurally equal but
2483+
differ in whitespace or similar details. Attributes include line numbers
2484+
and column offsets.
2485+
2486+
.. versionadded:: 3.14
2487+
2488+
24752489
.. _ast-cli:
24762490

24772491
Command-Line Usage

Doc/library/dataclasses.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@ Module contents
185185
- *slots*: If true (the default is ``False``), :attr:`~object.__slots__` attribute
186186
will be generated and new class will be returned instead of the original one.
187187
If :attr:`!__slots__` is already defined in the class, then :exc:`TypeError`
188-
is raised.
188+
is raised. Calling no-arg :func:`super` in dataclasses using ``slots=True`` will result in
189+
the following exception being raised:
190+
``TypeError: super(type, obj): obj must be an instance or subtype of type``.
191+
The two-arg :func:`super` is a valid workaround. See :gh:`90562` for full details.
189192

190193
.. versionadded:: 3.10
191194

Doc/library/dis.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -929,12 +929,13 @@ iterations of the loop.
929929
Exception representation on the stack now consist of one, not three, items.
930930

931931

932-
.. opcode:: LOAD_ASSERTION_ERROR
932+
.. opcode:: LOAD_COMMON_CONSTANT
933933

934-
Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert`
935-
statement.
934+
Pushes a common constant onto the stack. The interpreter contains a hardcoded
935+
list of constants supported by this instruction. Used by the :keyword:`assert`
936+
statement to load :exc:`AssertionError`.
936937

937-
.. versionadded:: 3.9
938+
.. versionadded:: 3.14
938939

939940

940941
.. opcode:: LOAD_BUILD_CLASS

Doc/library/functions.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,10 +623,6 @@ are always available. They are listed here in alphabetical order.
623623
means functions and classes defined in the executed code will not be able
624624
to access variables assigned at the top level (as the "top level"
625625
variables are treated as class variables in a class definition).
626-
Passing a :class:`collections.ChainMap` instance as *globals* allows name
627-
lookups to be chained across multiple mappings without triggering this
628-
behaviour. Values assigned to top level names in the executed code can be
629-
retrieved by passing an empty dictionary as the first entry in the chain.
630626

631627
If the *globals* dictionary does not contain a value for the key
632628
``__builtins__``, a reference to the dictionary of the built-in module

Doc/library/hashlib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
328328
your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers
329329
on the `stackexchange pbkdf2 iterations question`_ explain in detail.
330330

331-
*dklen* is the length of the derived key. If *dklen* is ``None`` then the
331+
*dklen* is the length of the derived key in bytes. If *dklen* is ``None`` then the
332332
digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512.
333333

334334
>>> from hashlib import pbkdf2_hmac
@@ -357,7 +357,7 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
357357

358358
*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization
359359
factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB).
360-
*dklen* is the length of the derived key.
360+
*dklen* is the length of the derived key in bytes.
361361

362362
.. versionadded:: 3.6
363363

Doc/library/stdtypes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4565,7 +4565,7 @@ can be used interchangeably to index the same dictionary entry.
45654565

45664566
Return a shallow copy of the dictionary.
45674567

4568-
.. classmethod:: fromkeys(iterable[, value])
4568+
.. classmethod:: fromkeys(iterable, value=None)
45694569

45704570
Create a new dictionary with keys from *iterable* and values set to *value*.
45714571

@@ -4575,7 +4575,7 @@ can be used interchangeably to index the same dictionary entry.
45754575
such as an empty list. To get distinct values, use a :ref:`dict
45764576
comprehension <dict>` instead.
45774577

4578-
.. method:: get(key[, default])
4578+
.. method:: get(key, default=None)
45794579

45804580
Return the value for *key* if *key* is in the dictionary, else *default*.
45814581
If *default* is not given, it defaults to ``None``, so that this method
@@ -4617,7 +4617,7 @@ can be used interchangeably to index the same dictionary entry.
46174617

46184618
.. versionadded:: 3.8
46194619

4620-
.. method:: setdefault(key[, default])
4620+
.. method:: setdefault(key, default=None)
46214621

46224622
If *key* is in the dictionary, return its value. If not, insert *key*
46234623
with a value of *default* and return *default*. *default* defaults to

Doc/using/cmdline.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,8 @@ Miscellaneous options
622622

623623
* :samp:`-X gil={0,1}` forces the GIL to be disabled or enabled,
624624
respectively. Only available in builds configured with
625-
:option:`--disable-gil`. See also :envvar:`PYTHON_GIL`.
625+
:option:`--disable-gil`. See also :envvar:`PYTHON_GIL` and
626+
:ref:`free-threaded-cpython`.
626627

627628
.. versionadded:: 3.13
628629

@@ -1212,7 +1213,7 @@ conflict.
12121213
forced on. Setting it to ``0`` forces the GIL off.
12131214

12141215
See also the :option:`-X gil <-X>` command-line option, which takes
1215-
precedence over this variable.
1216+
precedence over this variable, and :ref:`free-threaded-cpython`.
12161217

12171218
Needs Python configured with the :option:`--disable-gil` build option.
12181219

Doc/using/configure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ General Options
299299
Defines the ``Py_GIL_DISABLED`` macro and adds ``"t"`` to
300300
:data:`sys.abiflags`.
301301

302-
See :pep:`703` "Making the Global Interpreter Lock Optional in CPython".
302+
See :ref:`free-threaded-cpython` for more detail.
303303

304304
.. versionadded:: 3.13
305305

0 commit comments

Comments
 (0)