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
2 changes: 1 addition & 1 deletion Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ propagated, additional calls into the Python/C API may not behave as intended
and may fail in mysterious ways.

.. note::
The error indicator is **not** the result of :func:`sys.exc_info()`.
The error indicator is **not** the result of :func:`sys.exc_info`.
The former corresponds to an exception that is not yet caught (and is
therefore still propagating), while the latter returns an exception after
it is caught (and has therefore stopped propagating).
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Importing Modules

.. versionadded:: 3.2
.. versionchanged:: 3.3
Uses :func:`!imp.source_from_cache()` in calculating the source path if
Uses :func:`!imp.source_from_cache` in calculating the source path if
only the bytecode path is provided.
.. versionchanged:: 3.12
No longer uses the removed :mod:`!imp` module.
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/pending-removal-in-3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ APIs:
* ``read_binary()``
* ``read_text()``

Use :func:`importlib.resources.files()` instead. Refer to `importlib-resources: Migrating from Legacy
Use :func:`importlib.resources.files` instead. Refer to `importlib-resources: Migrating from Legacy
<https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy>`_ (:gh:`106531`)
4 changes: 2 additions & 2 deletions Doc/deprecations/pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Pending Removal in Python 3.15
* :class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python 3.11
and originally planned for removal in Python 3.13 (:gh:`90817`),
but removal has been postponed to Python 3.15.
Use :func:`locale.setlocale()`, :func:`locale.getencoding()` and
:func:`locale.getlocale()` instead.
Use :func:`locale.setlocale`, :func:`locale.getencoding` and
:func:`locale.getlocale` instead.
(Contributed by Hugo van Kemenade in :gh:`111187`.)

* :mod:`pathlib`:
Expand Down
2 changes: 1 addition & 1 deletion Doc/howto/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ were defined.

Descriptors are a powerful, general purpose protocol. They are the mechanism
behind properties, methods, static methods, class methods, and
:func:`super()`. They are used throughout Python itself. Descriptors
:func:`super`. They are used throughout Python itself. Descriptors
simplify the underlying C code and offer a flexible set of new tools for
everyday Python programs.

Expand Down
4 changes: 2 additions & 2 deletions Doc/howto/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Enum HOWTO
.. currentmodule:: enum

An :class:`Enum` is a set of symbolic names bound to unique values. They are
similar to global variables, but they offer a more useful :func:`repr()`,
similar to global variables, but they offer a more useful :func:`repr`,
grouping, type-safety, and a few other features.

They are most useful when you have a variable that can take one of a limited
Expand Down Expand Up @@ -167,7 +167,7 @@ And a function to display the chores for a given day::
answer SO questions

In cases where the actual values of the members do not matter, you can save
yourself some work and use :func:`auto()` for the values::
yourself some work and use :func:`auto` for the values::

>>> from enum import auto
>>> class Weekday(Flag):
Expand Down
2 changes: 1 addition & 1 deletion Doc/howto/instrumentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ Available static markers
.. object:: gc__start(int generation)

Fires when the Python interpreter starts a garbage collection cycle.
``arg0`` is the generation to scan, like :func:`gc.collect()`.
``arg0`` is the generation to scan, like :func:`gc.collect`.

.. object:: gc__done(long collected)

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/ast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2134,7 +2134,7 @@ and classes for traversing abstract syntax trees:
If ``type_comments=True`` is given, the parser is modified to check
and return type comments as specified by :pep:`484` and :pep:`526`.
This is equivalent to adding :data:`ast.PyCF_TYPE_COMMENTS` to the
flags passed to :func:`compile()`. This will report syntax errors
flags passed to :func:`compile`. This will report syntax errors
for misplaced type comments. Without this flag, type comments will
be ignored, and the ``type_comment`` field on selected AST nodes
will always be ``None``. In addition, the locations of ``# type:
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/asyncio-runner.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Runner context manager
current one. By default :func:`asyncio.new_event_loop` is used and set as
current event loop with :func:`asyncio.set_event_loop` if *loop_factory* is ``None``.

Basically, :func:`asyncio.run()` example can be rewritten with the runner usage::
Basically, :func:`asyncio.run` example can be rewritten with the runner usage::

async def main():
await asyncio.sleep(1)
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/compileall.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ compile Python sources.
.. option:: -j N

Use *N* workers to compile the files within the given directory.
If ``0`` is used, then the result of :func:`os.process_cpu_count()`
If ``0`` is used, then the result of :func:`os.process_cpu_count`
will be used.

.. option:: --invalidation-mode [timestamp|checked-hash|unchecked-hash]
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/contextvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function and the :class:`~contextvars.Context` class should be used to
manage the current context in asynchronous frameworks.

Context managers that have state should use Context Variables
instead of :func:`threading.local()` to prevent their state from
instead of :func:`threading.local` to prevent their state from
bleeding to other code unexpectedly, when used in concurrent code.

See also :pep:`567` for additional details.
Expand Down Expand Up @@ -146,7 +146,7 @@ Manual Context Management

Every thread will have a different top-level :class:`~contextvars.Context`
object. This means that a :class:`ContextVar` object behaves in a similar
fashion to :func:`threading.local()` when values are assigned in different
fashion to :func:`threading.local` when values are assigned in different
threads.

Context implements the :class:`collections.abc.Mapping` interface.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ Data Types
* the result is a valid *IntFlag*: an *IntFlag* is returned
* the result is not a valid *IntFlag*: the result depends on the :class:`FlagBoundary` setting

The :func:`repr()` of unnamed zero-valued flags has changed. It is now:
The :func:`repr` of unnamed zero-valued flags has changed. It is now:

>>> Color(0)
<Color: 0>
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ are always available. They are listed here in alphabetical order.
This function drops you into the debugger at the call site. Specifically,
it calls :func:`sys.breakpointhook`, passing ``args`` and ``kws`` straight
through. By default, ``sys.breakpointhook()`` calls
:func:`pdb.set_trace()` expecting no arguments. In this case, it is
:func:`pdb.set_trace` expecting no arguments. In this case, it is
purely a convenience function so you don't have to explicitly import
:mod:`pdb` or type as much code to enter the debugger. However,
:func:`sys.breakpointhook` can be set to some other function and
Expand Down Expand Up @@ -1329,7 +1329,7 @@ are always available. They are listed here in alphabetical order.
(which on *some* Unix systems, means that *all* writes append to the end of
the file regardless of the current seek position). In text mode, if
*encoding* is not specified the encoding used is platform-dependent:
:func:`locale.getencoding()` is called to get the current locale encoding.
:func:`locale.getencoding` is called to get the current locale encoding.
(For reading and writing raw bytes use binary mode and leave
*encoding* unspecified.) The available modes are:

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/functools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The :mod:`functools` module defines the following functions:
Returns the same as ``lru_cache(maxsize=None)``, creating a thin
wrapper around a dictionary lookup for the function arguments. Because it
never needs to evict old values, this is smaller and faster than
:func:`lru_cache()` with a size limit.
:func:`lru_cache` with a size limit.

For example::

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/getpass.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The :mod:`getpass` module provides two functions:
systems which support the :mod:`pwd` module, otherwise, an :exc:`OSError`
is raised.

In general, this function should be preferred over :func:`os.getlogin()`.
In general, this function should be preferred over :func:`os.getlogin`.

.. versionchanged:: 3.13
Previously, various exceptions beyond just :exc:`OSError` were raised.
12 changes: 6 additions & 6 deletions Doc/library/inspect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ Classes and functions
This function handles several details for you:

* If ``eval_str`` is true, values of type ``str`` will
be un-stringized using :func:`eval()`. This is intended
be un-stringized using :func:`eval`. This is intended
for use with stringized annotations
(``from __future__ import annotations``).
* If ``obj`` doesn't have an annotations dict, returns an
Expand All @@ -1250,16 +1250,16 @@ Classes and functions
* Always, always, always returns a freshly created dict.

``eval_str`` controls whether or not values of type ``str`` are replaced
with the result of calling :func:`eval()` on those values:
with the result of calling :func:`eval` on those values:

* If eval_str is true, :func:`eval()` is called on values of type ``str``.
(Note that ``get_annotations`` doesn't catch exceptions; if :func:`eval()`
* If eval_str is true, :func:`eval` is called on values of type ``str``.
(Note that ``get_annotations`` doesn't catch exceptions; if :func:`eval`
raises an exception, it will unwind the stack past the ``get_annotations``
call.)
* If eval_str is false (the default), values of type ``str`` are unchanged.

``globals`` and ``locals`` are passed in to :func:`eval()`; see the documentation
for :func:`eval()` for more information. If ``globals`` or ``locals``
``globals`` and ``locals`` are passed in to :func:`eval`; see the documentation
for :func:`eval` for more information. If ``globals`` or ``locals``
is ``None``, this function may replace that value with a context-specific
default, contingent on ``type(obj)``:

Expand Down
6 changes: 3 additions & 3 deletions Doc/library/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ Text I/O
:class:`TextIOBase`.

*encoding* gives the name of the encoding that the stream will be decoded or
encoded with. It defaults to :func:`locale.getencoding()`.
encoded with. It defaults to :func:`locale.getencoding`.
``encoding="locale"`` can be used to specify the current locale's encoding
explicitly. See :ref:`io-text-encoding` for more information.

Expand Down Expand Up @@ -1182,7 +1182,7 @@ re-enter a buffered object which it is already accessing, a :exc:`RuntimeError`
is raised. Note this doesn't prohibit a different thread from entering the
buffered object.

The above implicitly extends to text files, since the :func:`open()` function
The above implicitly extends to text files, since the :func:`open` function
will wrap a buffered object inside a :class:`TextIOWrapper`. This includes
standard streams and therefore affects the built-in :func:`print()` function as
standard streams and therefore affects the built-in :func:`print` function as
well.
2 changes: 1 addition & 1 deletion Doc/library/ipaddress.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ The module also provides the following module level functions:

doesn't make sense. There are some times however, where you may wish to
have :mod:`ipaddress` sort these anyway. If you need to do this, you can use
this function as the *key* argument to :func:`sorted()`.
this function as the *key* argument to :func:`sorted`.

*obj* is either a network or address object.

Expand Down
12 changes: 6 additions & 6 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ of the UTF-8 encoding:

* Use UTF-8 as the :term:`filesystem encoding <filesystem encoding and error
handler>`.
* :func:`sys.getfilesystemencoding()` returns ``'utf-8'``.
* :func:`locale.getpreferredencoding()` returns ``'utf-8'`` (the *do_setlocale*
* :func:`sys.getfilesystemencoding` returns ``'utf-8'``.
* :func:`locale.getpreferredencoding` returns ``'utf-8'`` (the *do_setlocale*
argument has no effect).
* :data:`sys.stdin`, :data:`sys.stdout`, and :data:`sys.stderr` all use
UTF-8 as their text encoding, with the ``surrogateescape``
Expand All @@ -133,8 +133,8 @@ level APIs also exhibit different default behaviours:

* Command line arguments, environment variables and filenames are decoded
to text using the UTF-8 encoding.
* :func:`os.fsdecode()` and :func:`os.fsencode()` use the UTF-8 encoding.
* :func:`open()`, :func:`io.open()`, and :func:`codecs.open()` use the UTF-8
* :func:`os.fsdecode` and :func:`os.fsencode` use the UTF-8 encoding.
* :func:`open`, :func:`io.open`, and :func:`codecs.open` use the UTF-8
encoding by default. However, they still use the strict error handler by
default so that attempting to open a binary file in text mode is likely
to raise an exception rather than producing nonsense data.
Expand Down Expand Up @@ -785,7 +785,7 @@ process and user.
``socket.gethostbyaddr(socket.gethostname())``.

On macOS, iOS and Android, this returns the *kernel* name and version (i.e.,
``'Darwin'`` on macOS and iOS; ``'Linux'`` on Android). :func:`platform.uname()`
``'Darwin'`` on macOS and iOS; ``'Linux'`` on Android). :func:`platform.uname`
can be used to get the user-facing operating system name and version on iOS and
Android.

Expand Down Expand Up @@ -2830,7 +2830,7 @@ features:

.. versionchanged:: 3.6
Added support for the :term:`context manager` protocol and the
:func:`~scandir.close()` method. If a :func:`scandir` iterator is neither
:func:`~scandir.close` method. If a :func:`scandir` iterator is neither
exhausted nor explicitly closed a :exc:`ResourceWarning` will be emitted
in its destructor.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/pdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You can then step through the code following this statement, and continue
running without the debugger using the :pdbcmd:`continue` command.

.. versionchanged:: 3.7
The built-in :func:`breakpoint()`, when called with defaults, can be used
The built-in :func:`breakpoint`, when called with defaults, can be used
instead of ``import pdb; pdb.set_trace()``.

::
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Cross Platform

On iOS and Android, this returns the user-facing OS name (i.e, ``'iOS``,
``'iPadOS'`` or ``'Android'``). To obtain the kernel name (``'Darwin'`` or
``'Linux'``), use :func:`os.uname()`.
``'Linux'``), use :func:`os.uname`.

.. function:: system_alias(system, release, version)

Expand All @@ -165,7 +165,7 @@ Cross Platform
returned if the value cannot be determined.

On iOS and Android, this is the user-facing OS version. To obtain the
Darwin or Linux kernel version, use :func:`os.uname()`.
Darwin or Linux kernel version, use :func:`os.uname`.

.. function:: uname()

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/signal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ The :mod:`signal` module defines the following functions:
signal to a particular Python thread would be to force a running system call
to fail with :exc:`InterruptedError`.

Use :func:`threading.get_ident()` or the :attr:`~threading.Thread.ident`
Use :func:`threading.get_ident` or the :attr:`~threading.Thread.ident`
attribute of :class:`threading.Thread` objects to get a suitable value
for *thread_id*.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3441,7 +3441,7 @@ place, and instead produce new objects.
``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``.

Unlike :func:`str.swapcase()`, it is always the case that
Unlike :func:`str.swapcase`, it is always the case that
``bin.swapcase().swapcase() == bin`` for the binary versions. Case
conversions are symmetrical in ASCII, even though that is not generally
true for arbitrary Unicode code points.
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/subprocess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ functions.

If *group* is not ``None``, the setregid() system call will be made in the
child process prior to the execution of the subprocess. If the provided
value is a string, it will be looked up via :func:`grp.getgrnam()` and
value is a string, it will be looked up via :func:`grp.getgrnam` and
the value in ``gr_gid`` will be used. If the value is an integer, it
will be passed verbatim. (POSIX only)

Expand All @@ -618,15 +618,15 @@ functions.
If *extra_groups* is not ``None``, the setgroups() system call will be
made in the child process prior to the execution of the subprocess.
Strings provided in *extra_groups* will be looked up via
:func:`grp.getgrnam()` and the values in ``gr_gid`` will be used.
:func:`grp.getgrnam` and the values in ``gr_gid`` will be used.
Integer values will be passed verbatim. (POSIX only)

.. availability:: POSIX
.. versionadded:: 3.9

If *user* is not ``None``, the setreuid() system call will be made in the
child process prior to the execution of the subprocess. If the provided
value is a string, it will be looked up via :func:`pwd.getpwnam()` and
value is a string, it will be looked up via :func:`pwd.getpwnam` and
the value in ``pw_uid`` will be used. If the value is an integer, it will
be passed verbatim. (POSIX only)

Expand Down
4 changes: 2 additions & 2 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,11 @@ always available.
regardless of their size. This function is mainly useful for tracking
and debugging memory leaks. Because of the interpreter's internal
caches, the result can vary from call to call; you may have to call
:func:`_clear_internal_caches()` and :func:`gc.collect()` to get more
:func:`_clear_internal_caches` and :func:`gc.collect` to get more
predictable results.

If a Python build or implementation cannot reasonably compute this
information, :func:`getallocatedblocks()` is allowed to return 0 instead.
information, :func:`getallocatedblocks` is allowed to return 0 instead.

.. versionadded:: 3.4

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/sysconfig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ Installation path functions
mix with those by the other.

End users should not use this function, but :func:`get_default_scheme` and
:func:`get_preferred_scheme()` instead.
:func:`get_preferred_scheme` instead.

.. versionadded:: 3.10

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/tarfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ be finalized; only the internally used file object will be closed. See the
it is best practice to only do so in top-level applications or
:mod:`site configuration <site>`.
To set a global default this way, a filter function needs to be wrapped in
:func:`staticmethod()` to prevent injection of a ``self`` argument.
:func:`staticmethod` to prevent injection of a ``self`` argument.

.. method:: TarFile.add(name, arcname=None, recursive=True, *, filter=None)

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1701,7 +1701,7 @@ The :mod:`test.support.warnings_helper` module provides support for warnings tes

.. function:: check_warnings(*filters, quiet=True)

A convenience wrapper for :func:`warnings.catch_warnings()` that makes it
A convenience wrapper for :func:`warnings.catch_warnings` that makes it
easier to test that a warning was correctly raised. It is approximately
equivalent to calling ``warnings.catch_warnings(record=True)`` with
:meth:`warnings.simplefilter` set to ``always`` and with the option to
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ Functions

.. impl-detail::

On CPython, use the same clock than :func:`time.monotonic()` and is a
On CPython, use the same clock than :func:`time.monotonic` and is a
monotonic clock, i.e. a clock that cannot go backwards.

Use :func:`perf_counter_ns` to avoid the precision loss caused by the
Expand All @@ -339,7 +339,7 @@ Functions
On Windows, the function is now system-wide.

.. versionchanged:: 3.13
Use the same clock than :func:`time.monotonic()`.
Use the same clock than :func:`time.monotonic`.


.. function:: perf_counter_ns() -> int
Expand Down
Loading
Loading