diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-10-24 15:30:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-24 15:30:21 (GMT) |
commit | edff7c1614d148f9c9bc66e834e387e5930b7a49 (patch) | |
tree | 962feac087ea0e379edf4a4f24dc5a2a0a767580 | |
parent | df531912a7eacd204805356ea3ea3481c43f9613 (diff) | |
download | cpython-edff7c1614d148f9c9bc66e834e387e5930b7a49.zip cpython-edff7c1614d148f9c9bc66e834e387e5930b7a49.tar.gz cpython-edff7c1614d148f9c9bc66e834e387e5930b7a49.tar.bz2 |
[3.12] gh-111151: Convert monospaced directives to :ref: (GH-111152) (#111269)
gh-111151: Convert monospaced directives to :ref: (GH-111152)
(cherry picked from commit 1198076447f35b19a9173866ccb9839f3bcf3f17)
Co-authored-by: InSync <122007197+InSyncWithFoo@users.noreply.github.com>
-rw-r--r-- | Doc/library/asyncio-eventloop.rst | 6 | ||||
-rw-r--r-- | Doc/library/asyncio.rst | 6 | ||||
-rw-r--r-- | Doc/library/typing.rst | 16 |
3 files changed, 20 insertions, 8 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index f14fa5f..0ff6136 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -661,6 +661,8 @@ Opening network connections Creating network servers ^^^^^^^^^^^^^^^^^^^^^^^^ +.. _loop_create_server: + .. coroutinemethod:: loop.create_server(protocol_factory, \ host=None, port=None, *, \ family=socket.AF_UNSPEC, \ @@ -1191,6 +1193,8 @@ Working with pipes Unix signals ^^^^^^^^^^^^ +.. _loop_add_signal_handler: + .. method:: loop.add_signal_handler(signum, callback, *args) Set *callback* as the handler for the *signum* signal. @@ -1419,6 +1423,8 @@ async/await code consider using the high-level :ref:`Subprocess Support on Windows <asyncio-windows-subprocess>` for details. +.. _loop_subprocess_exec: + .. coroutinemethod:: loop.subprocess_exec(protocol_factory, *args, \ stdin=subprocess.PIPE, stdout=subprocess.PIPE, \ stderr=subprocess.PIPE, **kwargs) diff --git a/Doc/library/asyncio.rst b/Doc/library/asyncio.rst index c75ab47..5f33c68 100644 --- a/Doc/library/asyncio.rst +++ b/Doc/library/asyncio.rst @@ -46,9 +46,9 @@ Additionally, there are **low-level** APIs for *library and framework developers* to: * create and manage :ref:`event loops <asyncio-event-loop>`, which - provide asynchronous APIs for :meth:`networking <loop.create_server>`, - running :meth:`subprocesses <loop.subprocess_exec>`, - handling :meth:`OS signals <loop.add_signal_handler>`, etc; + provide asynchronous APIs for :ref:`networking <loop_create_server>`, + running :ref:`subprocesses <loop_subprocess_exec>`, + handling :ref:`OS signals <loop_add_signal_handler>`, etc; * implement efficient protocols using :ref:`transports <asyncio-transports-protocols>`; diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 3eae779..44665b6 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -304,7 +304,7 @@ a callable with any arbitrary parameter list would be acceptable: x = concat # Also OK ``Callable`` cannot express complex signatures such as functions that take a -variadic number of arguments, :func:`overloaded functions <overload>`, or +variadic number of arguments, :ref:`overloaded functions <overload>`, or functions that have keyword-only parameters. However, these signatures can be expressed by defining a :class:`Protocol` class with a :meth:`~object.__call__` method: @@ -526,7 +526,7 @@ A user-defined class can be defined as a generic class. self.logger.info('%s: %s', self.name, message) This syntax indicates that the class ``LoggedVar`` is parameterised around a -single :class:`type variable <TypeVar>` ``T`` . This also makes ``T`` valid as +single :ref:`type variable <typevar>` ``T`` . This also makes ``T`` valid as a type within the class body. Generic classes implicitly inherit from :class:`Generic`. For compatibility @@ -1483,7 +1483,7 @@ These can be used as types in annotations. They all support subscription using Typing operator to conceptually mark an object as having been unpacked. For example, using the unpack operator ``*`` on a - :class:`type variable tuple <TypeVarTuple>` is equivalent to using ``Unpack`` + :ref:`type variable tuple <typevartuple>` is equivalent to using ``Unpack`` to mark the type variable tuple as having been unpacked:: Ts = TypeVarTuple('Ts') @@ -1574,6 +1574,8 @@ without the dedicated syntax, as documented below. ... # Etc. +.. _typevar: + .. class:: TypeVar(name, *constraints, bound=None, covariant=False, contravariant=False, infer_variance=False) Type variable. @@ -1718,9 +1720,11 @@ without the dedicated syntax, as documented below. :ref:`type parameter <type-params>` syntax introduced by :pep:`695`. The ``infer_variance`` parameter was added. +.. _typevartuple: + .. class:: TypeVarTuple(name) - Type variable tuple. A specialized form of :class:`type variable <TypeVar>` + Type variable tuple. A specialized form of :ref:`type variable <typevar>` that enables *variadic* generics. Type variable tuples can be declared in :ref:`type parameter lists <type-params>` @@ -1838,7 +1842,7 @@ without the dedicated syntax, as documented below. .. class:: ParamSpec(name, *, bound=None, covariant=False, contravariant=False) Parameter specification variable. A specialized version of - :class:`type variables <TypeVar>`. + :ref:`type variables <typevar>`. In :ref:`type parameter lists <type-params>`, parameter specifications can be declared with two asterisks (``**``):: @@ -2749,6 +2753,8 @@ Functions and decorators .. versionadded:: 3.11 +.. _overload: + .. decorator:: overload Decorator for creating overloaded functions and methods. |