diff --git a/Doc/conf.py b/Doc/conf.py index 467961dd5e2bff..68e66a3895422c 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -38,6 +38,7 @@ 'sphinx.ext.coverage', 'sphinx.ext.doctest', 'sphinx.ext.extlinks', + 'sphinx.ext.intersphinx', ] # Skip if downstream redistributors haven't installed them @@ -67,6 +68,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 84f77e8f206438..427c8c6ceaedbb 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -1650,7 +1650,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 @@ -1766,7 +1767,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 @@ -2008,7 +2009,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__ @@ -2168,8 +2169,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`