Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Android/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,12 +737,10 @@ def ci(context):
# Prove the package is self-contained by using it to run the tests.
shutil.unpack_archive(package_path, temp_dir)

# Arguments are similar to --fast-ci, but in single-process mode.
# Randomization is disabled because order-dependent failures are
# much less likely to pass on a rerun in single-process mode.
launcher_args = ["--managed", "maxVersion", "-v"]
test_args = [
"--single-process", "--fail-env-changed", "--rerun", "--slowest",
"--verbose3", "-u", "all,-cpu", "--timeout=600"
]
test_args = ["--fast-ci", "--single-process", "--no-randomize"]
run(
["./android.py", "test", *launcher_args, "--", *test_args],
cwd=temp_dir
Expand Down
9 changes: 0 additions & 9 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,6 @@
('envvar', 'USER'),
('envvar', 'USERNAME'),
('envvar', 'USERPROFILE'),
# Deprecated function that was never documented:
('py:func', 'getargspec'),
('py:func', 'inspect.getargspec'),
# Undocumented modules that users shouldn't have to worry about
# (implementation details of `os.path`):
('py:mod', 'ntpath'),
('py:mod', 'posixpath'),
]

# Temporary undocumented names.
Expand All @@ -242,8 +235,6 @@
('py:meth', '_SubParsersAction.add_parser'),
# Attributes/methods/etc. that definitely should be documented better,
# but are deferred for now:
('py:attr', '__annotations__'),
('py:meth', '__missing__'),
('py:attr', '__wrapped__'),
]

Expand Down
6 changes: 3 additions & 3 deletions Doc/library/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -758,9 +758,9 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,

.. attribute:: default_factory

This attribute is used by the :meth:`__missing__` method; it is
initialized from the first argument to the constructor, if present, or to
``None``, if absent.
This attribute is used by the :meth:`~defaultdict.__missing__` method;
it is initialized from the first argument to the constructor, if present,
or to ``None``, if absent.

.. versionchanged:: 3.9
Added merge (``|``) and update (``|=``) operators, specified in
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ Module contents
function is used.

This function is not strictly required, because any Python
mechanism for creating a new class with :attr:`!__annotations__` can
mechanism for creating a new class with :attr:`~object.__annotations__` can
then apply the :func:`@dataclass <dataclass>` function to convert that class to
a dataclass. This function is provided as a convenience. For
example::
Expand Down
5 changes: 5 additions & 0 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,11 @@ iterations of the loop.
Pushes ``co_consts[consti]`` onto the stack.


.. opcode:: LOAD_CONST_IMMORTAL (consti)

Works as :opcode:`LOAD_CONST`, but is more efficient for immortal objects.


.. opcode:: LOAD_SMALL_INT (i)

Pushes the integer ``i`` onto the stack.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/inspect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ Classes and functions
:func:`signature` in Python 3.5, but that decision has been reversed
in order to restore a clearly supported standard interface for
single-source Python 2/3 code migrating away from the legacy
:func:`getargspec` API.
:func:`!getargspec` API.

.. versionchanged:: 3.7
Python only explicitly guaranteed that it preserved the declaration
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/os.path.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ the :mod:`glob` module.)
a path that is *always* in one of the different formats. They all have the
same interface:

* :mod:`posixpath` for UNIX-style paths
* :mod:`ntpath` for Windows paths
* :mod:`!posixpath` for UNIX-style paths
* :mod:`!ntpath` for Windows paths


.. versionchanged:: 3.8
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ Pure paths provide the following methods and properties:
.. attribute:: PurePath.parser

The implementation of the :mod:`os.path` module used for low-level path
parsing and joining: either :mod:`posixpath` or :mod:`ntpath`.
parsing and joining: either :mod:`!posixpath` or :mod:`!ntpath`.

.. versionadded:: 3.13

Expand Down
11 changes: 6 additions & 5 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5014,13 +5014,13 @@ can be used interchangeably to index the same dictionary entry.

.. index:: __missing__()

If a subclass of dict defines a method :meth:`__missing__` and *key*
If a subclass of dict defines a method :meth:`~object.__missing__` and *key*
is not present, the ``d[key]`` operation calls that method with the key *key*
as argument. The ``d[key]`` operation then returns or raises whatever is
returned or raised by the ``__missing__(key)`` call.
No other operations or methods invoke :meth:`__missing__`. If
:meth:`__missing__` is not defined, :exc:`KeyError` is raised.
:meth:`__missing__` must be a method; it cannot be an instance variable::
No other operations or methods invoke :meth:`~object.__missing__`. If
:meth:`~object.__missing__` is not defined, :exc:`KeyError` is raised.
:meth:`~object.__missing__` must be a method; it cannot be an instance variable::

>>> class Counter(dict):
... def __missing__(self, key):
Expand All @@ -5034,7 +5034,8 @@ can be used interchangeably to index the same dictionary entry.
1

The example above shows part of the implementation of
:class:`collections.Counter`. A different ``__missing__`` method is used
:class:`collections.Counter`.
A different :meth:`!__missing__` method is used
by :class:`collections.defaultdict`.

.. describe:: d[key] = value
Expand Down
16 changes: 8 additions & 8 deletions Doc/reference/compound_stmts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,9 @@ The match statement is used for pattern matching. Syntax:

.. productionlist:: python-grammar
match_stmt: 'match' `subject_expr` ":" NEWLINE INDENT `case_block`+ DEDENT
subject_expr: `star_named_expression` "," `star_named_expressions`?
: | `named_expression`
case_block: 'case' `patterns` [`guard`] ":" `block`
subject_expr: `!star_named_expression` "," `!star_named_expressions`?
: | `!named_expression`
case_block: 'case' `patterns` [`guard`] ":" `!block`

.. note::
This section uses single quotes to denote
Expand Down Expand Up @@ -701,7 +701,7 @@ Guards
.. index:: ! guard

.. productionlist:: python-grammar
guard: "if" `named_expression`
guard: "if" `!named_expression`

A ``guard`` (which is part of the ``case``) must succeed for code inside
the ``case`` block to execute. It takes the form: :keyword:`if` followed by an
Expand Down Expand Up @@ -1015,8 +1015,8 @@ subject value:
items, as for a fixed-length sequence.

.. note:: The length of the subject sequence is obtained via
:func:`len` (i.e. via the :meth:`__len__` protocol). This length may be
cached by the interpreter in a similar manner as
:func:`len` (i.e. via the :meth:`~object.__len__` protocol).
This length may be cached by the interpreter in a similar manner as
:ref:`value patterns <value-patterns>`.


Expand Down Expand Up @@ -1067,8 +1067,8 @@ subject value:

.. note:: Key-value pairs are matched using the two-argument form of the mapping
subject's ``get()`` method. Matched key-value pairs must already be present
in the mapping, and not created on-the-fly via :meth:`__missing__` or
:meth:`~object.__getitem__`.
in the mapping, and not created on-the-fly via :meth:`~object.__missing__`
or :meth:`~object.__getitem__`.

In simple terms ``{KEY1: P1, KEY2: P2, ... }`` matches only if all the following
happens:
Expand Down
14 changes: 7 additions & 7 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ Sets

These represent a mutable set. They are created by the built-in :func:`set`
constructor and can be modified afterwards by several methods, such as
:meth:`~set.add`.
:meth:`add <frozenset.add>`.


Frozen sets
Expand Down Expand Up @@ -1272,7 +1272,7 @@ Special attributes
* - .. attribute:: type.__firstlineno__
- The line number of the first line of the class definition,
including decorators.
Setting the :attr:`__module__` attribute removes the
Setting the :attr:`~type.__module__` attribute removes the
:attr:`!__firstlineno__` item from the type's dictionary.

.. versionadded:: 3.13
Expand Down Expand Up @@ -1903,9 +1903,9 @@ falling back to :meth:`~object.__getitem__`). [#]_
When implementing a class that emulates any built-in type, it is important that
the emulation only be implemented to the degree that it makes sense for the
object being modelled. For example, some sequences may work well with retrieval
of individual elements, but extracting a slice may not make sense. (One example
of this is the :class:`~xml.dom.NodeList` interface in the W3C's Document
Object Model.)
of individual elements, but extracting a slice may not make sense.
(One example of this is the :ref:`NodeList <dom-nodelist-objects>` interface
in the W3C's Document Object Model.)


.. _customization:
Expand Down Expand Up @@ -2697,7 +2697,7 @@ class defining the method.
.. versionadded:: 3.6


When a class is created, :meth:`type.__new__` scans the class variables
When a class is created, :meth:`!type.__new__` scans the class variables
and makes callbacks to those with a :meth:`~object.__set_name__` hook.

.. method:: object.__set_name__(self, owner, name)
Expand Down Expand Up @@ -3145,7 +3145,7 @@ objects. The :mod:`collections.abc` module provides a
Mutable sequences should provide methods :meth:`~sequence.append`,
:meth:`~sequence.count`, :meth:`~sequence.index`, :meth:`~sequence.extend`,
:meth:`~sequence.insert`, :meth:`~sequence.pop`, :meth:`~sequence.remove`,
:meth:`~sequence.reverse` and :meth:`~sequence.sort`,
:meth:`~sequence.reverse` and :meth:`!sort`,
like Python standard :class:`list` objects.
Finally, sequence types should implement addition (meaning concatenation) and
multiplication (meaning repetition) by defining the methods
Expand Down
2 changes: 0 additions & 2 deletions Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ Doc/library/xml.sax.rst
Doc/library/xmlrpc.client.rst
Doc/library/xmlrpc.server.rst
Doc/library/zlib.rst
Doc/reference/compound_stmts.rst
Doc/reference/datamodel.rst
Doc/whatsnew/2.4.rst
Doc/whatsnew/2.5.rst
Doc/whatsnew/2.6.rst
2 changes: 1 addition & 1 deletion Doc/tools/check-warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from typing import TextIO

# Fail if NEWS nit found before this line number
NEWS_NIT_THRESHOLD = 1700
NEWS_NIT_THRESHOLD = 8550

# Exclude these whether they're dirty or clean,
# because they trigger a rebuild of dirty files.
Expand Down
2 changes: 1 addition & 1 deletion Doc/tutorial/controlflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ Function Annotations
information about the types used by user-defined functions (see :pep:`3107` and
:pep:`484` for more information).

:term:`Annotations <function annotation>` are stored in the :attr:`!__annotations__`
:term:`Annotations <function annotation>` are stored in the :attr:`~object.__annotations__`
attribute of the function as a dictionary and have no effect on any other part of the
function. Parameter annotations are defined by a colon after the parameter name, followed
by an expression evaluating to the value of the annotation. Return annotations are
Expand Down
13 changes: 8 additions & 5 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ dbm
This may harm performance, but improve crash tolerance.
(Contributed by Serhiy Storchaka in :gh:`66234`.)


difflib
-------

Expand Down Expand Up @@ -379,6 +380,7 @@ os.path
the resulting path can be missing but it will be free of symlinks.
(Contributed by Petr Viktorin for :cve:`2025-4517`.)


resource
--------

Expand Down Expand Up @@ -407,7 +409,7 @@ sqlite3
* Prompts, error messages, and help text are now colored.
This is enabled by default, see :ref:`using-on-controlling-color` for
details.
(Contributed by Stan Ulbrych and Łukasz Langa in :gh:`133461`)
(Contributed by Stan Ulbrych and Łukasz Langa in :gh:`133461`.)


ssl
Expand All @@ -433,7 +435,7 @@ ssl
agreement groups compatible with the minimum and maximum TLS versions
currently set in the context. This call requires OpenSSL 3.5 or later.

(Contributed by Ron Frederick in :gh:`136306`)
(Contributed by Ron Frederick in :gh:`136306`.)

* Added a new method :meth:`ssl.SSLContext.set_ciphersuites` for setting TLS 1.3
ciphers. For TLS 1.2 or earlier, :meth:`ssl.SSLContext.set_ciphers` should
Expand Down Expand Up @@ -692,12 +694,12 @@ New features

* Add :c:type:`PyUnstable_Unicode_GET_CACHED_HASH` to get the cached hash of
a string. See the documentation for caveats.
(Contributed by Petr Viktorin in :gh:`131510`)
(Contributed by Petr Viktorin in :gh:`131510`.)

* Add API for checking an extension module's ABI compatibility:
:c:data:`Py_mod_abi`, :c:func:`PyABIInfo_Check`, :c:macro:`PyABIInfo_VAR`
and :c:data:`Py_mod_abi`.
(Contributed by Petr Viktorin in :gh:`137210`)
(Contributed by Petr Viktorin in :gh:`137210`.)


Porting to Python 3.15
Expand Down Expand Up @@ -750,6 +752,7 @@ Deprecated C APIs
:c:func:`_Py_c_abs` are :term:`soft deprecated`.
(Contributed by Sergey B Kirpichev in :gh:`128813`.)


.. Add C API deprecations above alphabetically, not here at the end.

Removed C APIs
Expand All @@ -768,7 +771,7 @@ Removed C APIs
Use :c:func:`PyCodec_Encode` instead; Note that some codecs (for example, "base64")
may return a type other than :class:`bytes`, such as :class:`str`.

(Contributed by Stan Ulbrych in :gh:`133612`)
(Contributed by Stan Ulbrych in :gh:`133612`.)

* :c:func:`!PyImport_ImportModuleNoBlock`: deprecated alias
of :c:func:`PyImport_ImportModule`.
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ Some smaller changes made to the core Python language are:
:class:`~collections.defaultdict`, :class:`~shelve.Shelf`,
:class:`~configparser.ConfigParser`, or :mod:`dbm`. It is also useful with
custom :class:`dict` subclasses that normalize keys before look-up or that
supply a :meth:`__missing__` method for unknown keys::
supply a :meth:`~object.__missing__` method for unknown keys::

>>> import shelve
>>> d = shelve.open('tmp.shl')
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ As part of the implementation of the new :mod:`enum` module, the
metaclasses. (Contributed by Ethan Furman in :issue:`18929` and
:issue:`19030`.)

:func:`~inspect.getfullargspec` and :func:`~inspect.getargspec`
:func:`~inspect.getfullargspec` and :func:`!getargspec`
now use the :func:`~inspect.signature` API. This allows them to
support a much broader range of callables, including those with
``__signature__`` attributes, those with metadata provided by argument
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,7 @@ The previously undocumented ``from_function`` and ``from_builtin`` methods of
:meth:`Signature.from_callable() <inspect.Signature.from_callable>`
method instead. (Contributed by Yury Selivanov in :issue:`24248`.)

The :func:`inspect.getargspec` function is deprecated and scheduled to be
The :func:`!inspect.getargspec` function is deprecated and scheduled to be
removed in Python 3.6. (See :issue:`20438` for details.)

The :mod:`inspect` :func:`~inspect.getfullargspec`,
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ generator expression scopes as if they were positional-only parameters called
``implicit0``. (Contributed by Jelle Zijlstra in :issue:`19611`.)

To reduce code churn when upgrading from Python 2.7 and the legacy
:func:`inspect.getargspec` API, the previously documented deprecation of
:func:`!inspect.getargspec` API, the previously documented deprecation of
:func:`inspect.getfullargspec` has been reversed. While this function is
convenient for single/source Python 2/3 code bases, the richer
:func:`inspect.signature` interface remains the recommended approach for new
Expand Down
2 changes: 2 additions & 0 deletions Include/internal/pycore_global_objects_fini_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Include/internal/pycore_global_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(format)
STRUCT_FOR_ID(format_spec)
STRUCT_FOR_ID(frame_buffer)
STRUCT_FOR_ID(free_threaded)
STRUCT_FOR_ID(from_param)
STRUCT_FOR_ID(fromlist)
STRUCT_FOR_ID(fromtimestamp)
Expand Down Expand Up @@ -673,6 +674,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(person)
STRUCT_FOR_ID(pi_factory)
STRUCT_FOR_ID(pid)
STRUCT_FOR_ID(pointer_bits)
STRUCT_FOR_ID(policy)
STRUCT_FOR_ID(pos)
STRUCT_FOR_ID(pos1)
Expand Down
2 changes: 2 additions & 0 deletions Include/internal/pycore_runtime_init_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading