diff --git a/Doc/conf.py b/Doc/conf.py index e2dff74538a3422..b2285a99e59e72d 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -39,6 +39,7 @@ 'sphinx.ext.coverage', 'sphinx.ext.doctest', 'sphinx.ext.extlinks', + 'sphinx.ext.intersphinx', ] # Skip if downstream redistributors haven't installed them @@ -70,6 +71,12 @@ manpages_url = 'https://manpages.debian.org/{path}' +# Intersphinx configuration +intersphinx_mapping = { + 'typing': ('https://typing.python.org/en/latest/', None), +} +intersphinx_disabled_reftypes = [] + # General substitutions. project = 'Python' copyright = "2001 Python Software Foundation" diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 2ce868cf84da9d5..7ab27eca4963211 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -1726,7 +1726,8 @@ These can be used as types in annotations. They all support subscription using # and `year` of type `int`. def foo(**kwargs: Unpack[Movie]): ... - See :pep:`692` for more details on using ``Unpack`` for ``**kwargs`` typing. + See :ref:`the typing spec ` for more details on using + ``Unpack`` for ``**kwargs`` typing. .. versionadded:: 3.11 @@ -1842,7 +1843,7 @@ without the dedicated syntax, as documented below. Manually created type variables may be explicitly marked covariant or contravariant by passing ``covariant=True`` or ``contravariant=True``. By default, manually created type variables are invariant. - See :pep:`484` and :pep:`695` for more details. + See :ref:`the typing spec ` for more details. Bounded type variables and constrained type variables have different semantics in several important ways. Using a *bounded* type variable means @@ -2084,7 +2085,7 @@ without the dedicated syntax, as documented below. to ``call_soon`` match the types of the (positional) arguments of ``callback``. - See :pep:`646` for more details on type variable tuples. + See :ref:`the typing spec ` for more details on type variable tuples. .. attribute:: __name__ @@ -2244,8 +2245,7 @@ without the dedicated syntax, as documented below. be pickled. .. seealso:: - * :pep:`612` -- Parameter Specification Variables (the PEP which introduced - ``ParamSpec`` and ``Concatenate``) + * :ref:`typing:paramspec` -- typing specification for ``ParamSpec`` * :data:`Concatenate` * :ref:`annotating-callables`