Creating network servers
^^^^^^^^^^^^^^^^^^^^^^^^
+.. _loop_create_server:
+
.. coroutinemethod:: loop.create_server(protocol_factory, \
host=None, port=None, *, \
family=socket.AF_UNSPEC, \
Unix signals
^^^^^^^^^^^^
+.. _loop_add_signal_handler:
+
.. method:: loop.add_signal_handler(signum, callback, *args)
Set *callback* as the handler for the *signum* signal.
: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)
*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>`;
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:
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')
except KeyError:
return default
+.. _typevar:
+
.. class:: TypeVar(name, *constraints, bound=None, covariant=False, contravariant=False)
Type variable.
A tuple containing the constraints of the type variable, if any.
+.. _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.
Usage::
.. class:: ParamSpec(name, *, bound=None, covariant=False, contravariant=False)
Parameter specification variable. A specialized version of
- :class:`type variables <TypeVar>`.
+ :ref:`type variables <typevar>`.
Usage::
.. versionadded:: 3.11
+.. _overload:
+
.. decorator:: overload
Decorator for creating overloaded functions and methods.