gh-118181: Fix parameter markup in AST docs (#124473)

This commit is contained in:
Tomas R 2024-09-26 15:38:25 +02:00 committed by GitHub
parent 274d9ab619
commit 09aebb1fbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -178,9 +178,9 @@ Root nodes
A Python module, as with :ref:`file input <file-input>`. A Python module, as with :ref:`file input <file-input>`.
Node type generated by :func:`ast.parse` in the default ``"exec"`` *mode*. Node type generated by :func:`ast.parse` in the default ``"exec"`` *mode*.
*body* is a :class:`list` of the module's :ref:`ast-statements`. ``body`` is a :class:`list` of the module's :ref:`ast-statements`.
*type_ignores* is a :class:`list` of the module's type ignore comments; ``type_ignores`` is a :class:`list` of the module's type ignore comments;
see :func:`ast.parse` for more details. see :func:`ast.parse` for more details.
.. doctest:: .. doctest::
@ -199,7 +199,7 @@ Root nodes
A single Python :ref:`expression input <expression-input>`. A single Python :ref:`expression input <expression-input>`.
Node type generated by :func:`ast.parse` when *mode* is ``"eval"``. Node type generated by :func:`ast.parse` when *mode* is ``"eval"``.
*body* is a single node, ``body`` is a single node,
one of the :ref:`expression types <ast-expressions>`. one of the :ref:`expression types <ast-expressions>`.
.. doctest:: .. doctest::
@ -214,7 +214,7 @@ Root nodes
A single :ref:`interactive input <interactive>`, like in :ref:`tut-interac`. A single :ref:`interactive input <interactive>`, like in :ref:`tut-interac`.
Node type generated by :func:`ast.parse` when *mode* is ``"single"``. Node type generated by :func:`ast.parse` when *mode* is ``"single"``.
*body* is a :class:`list` of :ref:`statement nodes <ast-statements>`. ``body`` is a :class:`list` of :ref:`statement nodes <ast-statements>`.
.. doctest:: .. doctest::
@ -243,9 +243,9 @@ Root nodes
# type: (int, int) -> int # type: (int, int) -> int
return a + b return a + b
*argtypes* is a :class:`list` of :ref:`expression nodes <ast-expressions>`. ``argtypes`` is a :class:`list` of :ref:`expression nodes <ast-expressions>`.
*returns* is a single :ref:`expression node <ast-expressions>`. ``returns`` is a single :ref:`expression node <ast-expressions>`.
.. doctest:: .. doctest::
@ -1771,9 +1771,9 @@ aliases.
.. class:: TypeVar(name, bound, default_value) .. class:: TypeVar(name, bound, default_value)
A :class:`typing.TypeVar`. *name* is the name of the type variable. A :class:`typing.TypeVar`. ``name`` is the name of the type variable.
*bound* is the bound or constraints, if any. If *bound* is a :class:`Tuple`, ``bound`` is the bound or constraints, if any. If ``bound`` is a :class:`Tuple`,
it represents constraints; otherwise it represents the bound. *default_value* it represents constraints; otherwise it represents the bound. ``default_value``
is the default value; if the :class:`!TypeVar` has no default, this is the default value; if the :class:`!TypeVar` has no default, this
attribute will be set to ``None``. attribute will be set to ``None``.
@ -1801,8 +1801,8 @@ aliases.
.. class:: ParamSpec(name, default_value) .. class:: ParamSpec(name, default_value)
A :class:`typing.ParamSpec`. *name* is the name of the parameter specification. A :class:`typing.ParamSpec`. ``name`` is the name of the parameter specification.
*default_value* is the default value; if the :class:`!ParamSpec` has no default, ``default_value`` is the default value; if the :class:`!ParamSpec` has no default,
this attribute will be set to ``None``. this attribute will be set to ``None``.
.. doctest:: .. doctest::
@ -1836,8 +1836,8 @@ aliases.
.. class:: TypeVarTuple(name, default_value) .. class:: TypeVarTuple(name, default_value)
A :class:`typing.TypeVarTuple`. *name* is the name of the type variable tuple. A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable tuple.
*default_value* is the default value; if the :class:`!TypeVarTuple` has no ``default_value`` is the default value; if the :class:`!TypeVarTuple` has no
default, this attribute will be set to ``None``. default, this attribute will be set to ``None``.
.. doctest:: .. doctest::