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
3 changes: 2 additions & 1 deletion Doc/library/calendar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,8 @@ For simple text calendars this module provides the following functions.

.. function:: prcal(theyear, w=0, l=0, c=6, m=3)

Prints the calendar for an entire year as returned by :func:`calendar`.
Prints the calendar for an entire year as returned by
:func:`~calendar.calendar`.


.. function:: calendar(theyear, w=2, l=1, c=6, m=3)
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3758,9 +3758,9 @@ fields, or any other data types containing pointer type fields.
.. class:: CFieldInfo(anonymous=False, bit_width=None)
:module: ctypes.util

Information regarding a structure field defined by the :func:`struct`
decorator. This should be used in the second argument of a
:class:`typing.Annotated` wrapping a ctypes type.
Information regarding a structure field defined by the
:func:`~ctypes.util.struct` decorator. This should be used in the second
argument of a :class:`typing.Annotated` wrapping a ctypes type.

*anonymous* specifies whether the field will be present in the
:attr:`~ctypes.Structure._anonymous_` attribute of the generated class.
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1386,9 +1386,9 @@ Instance methods:
hour=self.hour, minute=self.minute, second=self.second, microsecond=self.microsecond, \
tzinfo=self.tzinfo, *, fold=0)

Return a new :class:`datetime` object with the same attributes, but with
specified parameters updated. Note that ``tzinfo=None`` can be specified to
create a naive datetime from an aware datetime with no conversion of date
Return a new :class:`~datetime.datetime` object with the same attributes, but
with specified parameters updated. Note that ``tzinfo=None`` can be specified
to create a naive datetime from an aware datetime with no conversion of date
and time data.

:class:`.datetime` objects are also supported by generic function
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,9 @@ operation is being performed, so the intermediate analysis object isn't useful:
source line information (if any) is taken directly from the disassembled code
object.

The *adaptive* parameter works as it does in :func:`dis`.
The *adaptive* parameter works as it does in :func:`~dis.dis`.

The *show_jit* parameter works as it does in :func:`dis`.
The *show_jit* parameter works as it does in :func:`~dis.dis`.

.. versionadded:: 3.4

Expand Down
3 changes: 2 additions & 1 deletion Doc/library/fnmatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ a :class:`!str` filename, and vice-versa.

Finally, note that :deco:`functools.lru_cache` with a *maxsize* of 32768
is used to cache the (typed) compiled regex patterns in the following
functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`, :func:`.filterfalse`.
functions: :func:`~fnmatch.fnmatch`, :func:`fnmatchcase`, :func:`.filter`,
:func:`.filterfalse`.


.. function:: fnmatch(name, pat)
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/getopt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ exception:

.. function:: gnu_getopt(args, shortopts, longopts=[])

This function works like :func:`getopt`, except that GNU style scanning mode is
used by default. This means that option and non-option arguments may be
intermixed. The :func:`getopt` function stops processing options as soon as a
non-option argument is encountered.
This function works like :func:`~getopt.getopt`, except that GNU style
scanning mode is used by default. This means that option and non-option
arguments may be intermixed. The :func:`~getopt.getopt` function stops
processing options as soon as a non-option argument is encountered.

If the first character of the option string is ``'+'``, or if the environment
variable :envvar:`!POSIXLY_CORRECT` is set, then option processing stops as
Expand Down
9 changes: 5 additions & 4 deletions Doc/library/getpass.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ The :mod:`!getpass` module provides two functions:
typed character is replaced by it. For example, ``echo_char='*'`` will
display asterisks instead of the actual input.

If echo-free input is unavailable, :func:`getpass` falls back to printing
a warning message to *stream* and reading from :data:`sys.stdin` and
If echo-free input is unavailable, :func:`~getpass.getpass` falls back to
printing a warning message to *stream* and reading from :data:`sys.stdin` and
issuing a :exc:`GetPassWarning`.

.. note::
If you call :func:`getpass` from within IDLE, the input may be done in the
terminal you launched IDLE from rather than the idle window itself.
If you call :func:`~getpass.getpass` from within IDLE, the input may be
done in the terminal you launched IDLE from rather than the idle window
itself.

.. note::
On Unix systems, when *echo_char* is set, the terminal will be
Expand Down
8 changes: 5 additions & 3 deletions Doc/library/gettext.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ class-based API instead.
.. function:: dnpgettext(domain, context, singular, plural, n, /)

Similar to the corresponding functions without the ``p`` in the prefix (that
is, :func:`gettext`, :func:`dgettext`, :func:`ngettext`, :func:`dngettext`),
but the translation is restricted to the given message *context*.
is, :func:`~gettext.gettext`, :func:`dgettext`, :func:`ngettext`,
:func:`dngettext`), but the translation is restricted to the given message
*context*.

.. versionadded:: 3.8

Expand Down Expand Up @@ -426,7 +427,8 @@ take the following steps:

In order to prepare your code for I18N, you need to look at all the strings in
your files. Any string that needs to be translated should be marked by wrapping
it in ``_('...')`` --- that is, a call to the function :func:`_ <gettext>`. For example::
it in ``_('...')`` --- that is, a call to the function
:func:`_ <gettext.gettext>`. For example::

filename = 'mylog.txt'
message = _('writing a log message')
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/glob.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ The :mod:`!glob` module defines the following functions:
.. function:: iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False, \
include_hidden=False)

Return an :term:`iterator` which yields the same values as :func:`glob`
Return an :term:`iterator` which yields the same values as :func:`~glob.glob`
without actually storing them all simultaneously.

.. audit-event:: glob.glob pathname,recursive glob.iglob
Expand Down Expand Up @@ -182,7 +182,7 @@ Examples

Consider a directory containing the following files:
:file:`1.gif`, :file:`2.txt`, :file:`card.gif` and a subdirectory :file:`sub`
which contains only the file :file:`3.txt`. :func:`glob` will produce
which contains only the file :file:`3.txt`. :func:`~glob.glob` will produce
the following results. Notice how any leading components of the path are
preserved. ::

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ Access to message catalogs
.. function:: bind_textdomain_codeset(domain, codeset)

The locale module exposes the C library's gettext interface on systems that
provide this interface. It consists of the functions :func:`gettext`,
provide this interface. It consists of the functions :func:`~locale.gettext`,
:func:`dgettext`, :func:`dcgettext`, :func:`textdomain`, :func:`bindtextdomain`,
and :func:`bind_textdomain_codeset`. These are similar to the same functions in
the :mod:`gettext` module, but use the C library's binary format for message
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/marshal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ this module. The following types are supported:
therein are themselves supported.
Recursive containers are supported since :data:`version` 3.
* The singletons :const:`None`, :const:`Ellipsis` and :exc:`StopIteration`.
* :class:`code` objects, if *allow_code* is true. See note above about
version dependence.
* :class:`code <types.CodeType>` objects, if *allow_code* is true. See note
above about version dependence.

.. versionchanged:: 3.4

Expand Down
14 changes: 7 additions & 7 deletions Doc/library/mmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ ACCESS_* constants
:const:`ACCESS_READ` provides read-only access, :const:`ACCESS_WRITE`
provides write-through access, and :const:`ACCESS_COPY` provides
copy-on-write access. :const:`ACCESS_DEFAULT` defers to the *prot*
argument of :class:`mmap`.
argument of :class:`~mmap.mmap`.

.. _page-size-constants:

Expand All @@ -413,7 +413,7 @@ Page size constants

:const:`PAGESIZE` is the system memory page size in bytes.
:const:`ALLOCATIONGRANULARITY` is the minimum alignment in bytes required
for the *offset* argument of :class:`mmap`. On Unix,
for the *offset* argument of :class:`~mmap.mmap`. On Unix,
:const:`ALLOCATIONGRANULARITY` is equal to :const:`PAGESIZE`.

.. _prot-constants:
Expand All @@ -425,11 +425,11 @@ PROT_* constants
PROT_WRITE
PROT_EXEC

Memory protection flags accepted by the *prot* argument of :class:`mmap`.
:const:`PROT_READ` allows pages to be read, :const:`PROT_WRITE` allows pages
to be written, and :const:`PROT_EXEC` allows pages to be executed. Values
can be combined using the bitwise OR operator. Not every option is present
on every system.
Memory protection flags accepted by the *prot* argument of
:class:`~mmap.mmap`. :const:`PROT_READ` allows pages to be read,
:const:`PROT_WRITE` allows pages to be written, and :const:`PROT_EXEC` allows
pages to be executed. Values can be combined using the bitwise OR operator.
Not every option is present on every system.

.. availability:: Unix.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/msvcrt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
These functions provide access to some useful capabilities on Windows platforms.
Some higher-level modules use these functions to build the Windows
implementations of their services. For example, the :mod:`getpass` module uses
this in the implementation of the :func:`getpass` function.
this in the implementation of the :func:`~getpass.getpass` function.

Further documentation on these functions can be found in the Platform API
documentation.
Expand Down
9 changes: 5 additions & 4 deletions Doc/library/multiprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2462,10 +2462,11 @@ with the :class:`Pool` class.
the process which created the pool.

.. warning::
:class:`multiprocessing.pool` objects have internal resources that need to be
properly managed (like any other resource) by using the pool as a context manager
or by calling :meth:`close` and :meth:`terminate` manually. Failure to do this
can lead to the process hanging on finalization.
:class:`~multiprocessing.pool.Pool` objects have internal resources that
need to be properly managed (like any other resource) by using the pool as
a context manager or by calling :meth:`close` and :meth:`terminate`
manually. Failure to do this can lead to the process hanging on
finalization.

Note that it is **not correct** to rely on the garbage collector to destroy the pool
as CPython does not assure that the finalizer of the pool will be called
Expand Down
19 changes: 12 additions & 7 deletions Doc/library/multiprocessing.shared_memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,17 @@ same :class:`!numpy.ndarray` from two distinct Python shells:
of all shared memory blocks managed by that process, call
:meth:`~multiprocessing.managers.BaseManager.shutdown` on the instance.
This triggers a :meth:`~multiprocessing.shared_memory.SharedMemory.unlink` call
on all of the :class:`SharedMemory` objects managed by that process and then
stops the process itself. By creating :class:`!SharedMemory` instances
on all of the :class:`~multiprocessing.shared_memory.SharedMemory` objects
managed by that process and then stops the process itself.
By creating :class:`!SharedMemory` instances
through a :class:`!SharedMemoryManager`, we avoid the need to manually track
and trigger the freeing of shared memory resources.

This class provides methods for creating and returning :class:`SharedMemory`
instances and for creating a list-like object (:class:`ShareableList`)
backed by shared memory.
This class provides methods for creating and returning
:class:`~multiprocessing.shared_memory.SharedMemory` instances and for
creating a list-like object
(:class:`~multiprocessing.shared_memory.ShareableList`) backed by shared
memory.

Refer to :class:`~multiprocessing.managers.BaseManager` for a description
of the inherited *address* and *authkey* optional input arguments and how
Expand All @@ -231,12 +234,14 @@ same :class:`!numpy.ndarray` from two distinct Python shells:

.. method:: SharedMemory(size)

Create and return a new :class:`SharedMemory` object with the
Create and return a new
:class:`~multiprocessing.shared_memory.SharedMemory` object with the
specified *size* in bytes.

.. method:: ShareableList(sequence)

Create and return a new :class:`ShareableList` object, initialized
Create and return a new
:class:`~multiprocessing.shared_memory.ShareableList` object, initialized
by the values from the input *sequence*.


Expand Down
2 changes: 1 addition & 1 deletion Doc/library/netrc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ the Unix :program:`ftp` program and other FTP clients.
:file:`.netrc` file when *file* is not passed as argument.

.. versionchanged:: 3.10
:class:`netrc` try UTF-8 encoding before using locale specific
:class:`~netrc.netrc` try UTF-8 encoding before using locale specific
encoding.
The entry in the netrc file no longer needs to contain all tokens. The missing
tokens' value default to an empty string. All the tokens and their values now
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/optparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2040,10 +2040,10 @@ Finally, the Option subclass::
TYPE_CHECKER = copy(Option.TYPE_CHECKER)
TYPE_CHECKER["complex"] = check_complex

(If we didn't make a :func:`copy` of :attr:`Option.TYPE_CHECKER`, we would end
up modifying the :attr:`~Option.TYPE_CHECKER` attribute of :mod:`!optparse`'s
Option class. This being Python, nothing stops you from doing that except good
manners and common sense.)
(If we didn't make a :func:`~copy.copy` of :attr:`Option.TYPE_CHECKER`, we would
end up modifying the :attr:`~Option.TYPE_CHECKER` attribute of
:mod:`!optparse`'s Option class. This being Python, nothing stops you from
doing that except good manners and common sense.)

That's it! Now you can write a script that uses the new option type just like
any other :mod:`!optparse`\ -based script, except you have to instruct your
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/random.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ Functions for sequences
to specify both *weights* and *cum_weights*.

The *weights* or *cum_weights* can use any numeric type that interoperates
with the :class:`float` values returned by :func:`random` (that includes
integers, floats, and fractions but excludes decimals). Weights are assumed
to be non-negative and finite. A :exc:`ValueError` is raised if all
with the :class:`float` values returned by :func:`~random.random` (that
includes integers, floats, and fractions but excludes decimals). Weights are
assumed to be non-negative and finite. A :exc:`ValueError` is raised if all
weights are zero.

For a given seed, the :func:`choices` function with equal weighting
Expand Down
20 changes: 10 additions & 10 deletions Doc/library/shlex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -411,16 +411,16 @@ Improved Compatibility with Shells

.. versionadded:: 3.6

The :class:`shlex` class provides compatibility with the parsing performed by
common Unix shells like ``bash``, ``dash``, and ``sh``. To take advantage of
this compatibility, specify the ``punctuation_chars`` argument in the
constructor. This defaults to ``False``, which preserves pre-3.6 behaviour.
However, if it is set to ``True``, then parsing of the characters ``();<>|&``
is changed: any run of these characters is returned as a single token. While
this is short of a full parser for shells (which would be out of scope for the
standard library, given the multiplicity of shells out there), it does allow
you to perform processing of command lines more easily than you could
otherwise. To illustrate, you can see the difference in the following snippet:
The :class:`~shlex.shlex` class provides compatibility with the parsing
performed by common Unix shells like ``bash``, ``dash``, and ``sh``. To take
advantage of this compatibility, specify the ``punctuation_chars`` argument in
the constructor. This defaults to ``False``, which preserves pre-3.6 behaviour.
However, if it is set to ``True``, then parsing of the characters ``();<>|&`` is
changed: any run of these characters is returned as a single token. While this
is short of a full parser for shells (which would be out of scope for the
standard library, given the multiplicity of shells out there), it does allow you
to perform processing of command lines more easily than you could otherwise. To
illustrate, you can see the difference in the following snippet:

.. doctest::
:options: +NORMALIZE_WHITESPACE
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/signal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,8 @@ The :mod:`!signal` module defines the following functions:

See the man page :manpage:`siginterrupt(3)` for further information.

Note that installing a signal handler with :func:`signal` will reset the
restart behaviour to interruptible by implicitly calling
Note that installing a signal handler with :func:`~signal.signal` will reset
the restart behaviour to interruptible by implicitly calling
:c:func:`!siginterrupt` with a true *flag* value for the given signal.


Expand All @@ -627,7 +627,7 @@ The :mod:`!signal` module defines the following functions:
see the :ref:`description in the type hierarchy <frame-objects>` or see the
attribute descriptions in the :mod:`inspect` module).

On Windows, :func:`signal` can only be called with :const:`SIGABRT`,
On Windows, :func:`~signal.signal` can only be called with :const:`SIGABRT`,
:const:`SIGFPE`, :const:`SIGILL`, :const:`SIGINT`, :const:`SIGSEGV`,
:const:`SIGTERM`, or :const:`SIGBREAK`.
A :exc:`ValueError` will be raised in any other case.
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,8 @@ always available. Unless explicitly noted otherwise, all variables are read-only
particular, ``sys.exit("some error message")`` is a quick way to exit a
program when an error occurs.

Since :func:`exit` ultimately "only" raises an exception, it will only exit
the process when called from the main thread, and the exception is not
Since :func:`~sys.exit` ultimately "only" raises an exception, it will only
exit the process when called from the main thread, and the exception is not
intercepted. Cleanup actions specified by :keyword:`finally` clauses of
:keyword:`try` statements are honored, and it is possible to intercept the
exit attempt at an outer level.
Expand Down
Loading
Loading