Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.12] gh-103921: Minor PEP-695 fixes to the ast module docs (GH-105093) #105101

Merged
merged 1 commit into from
May 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Doc/library/ast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1744,17 +1744,17 @@ aliases.
Function and class definitions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. class:: FunctionDef(name, type_params, args, body, decorator_list, returns, type_comment)
.. class:: FunctionDef(name, args, body, decorator_list, returns, type_comment, type_params)

A function definition.

* ``name`` is a raw string of the function name.
* ``type_params`` is a list of :ref:`type parameters <ast-type-params>`.
* ``args`` is an :class:`arguments` node.
* ``body`` is the list of nodes inside the function.
* ``decorator_list`` is the list of decorators to be applied, stored outermost
first (i.e. the first in the list will be applied last).
* ``returns`` is the return annotation.
* ``type_params`` is a list of :ref:`type parameters <ast-type-params>`.

.. attribute:: type_comment

Expand Down Expand Up @@ -1917,19 +1917,19 @@ Function and class definitions
type_ignores=[])


.. class:: ClassDef(name, type_params, bases, keywords, body, decorator_list)
.. class:: ClassDef(name, bases, keywords, body, decorator_list, type_params)

A class definition.

* ``name`` is a raw string for the class name
* ``type_params`` is a list of :ref:`type parameters <ast-type-params>`.
* ``bases`` is a list of nodes for explicitly specified base classes.
* ``keywords`` is a list of :class:`keyword` nodes, principally for 'metaclass'.
Other keywords will be passed to the metaclass, as per `PEP-3115
<https://peps.python.org/pep-3115/>`_.
* ``body`` is a list of nodes representing the code within the class
definition.
* ``decorator_list`` is a list of nodes, as in :class:`FunctionDef`.
* ``type_params`` is a list of :ref:`type parameters <ast-type-params>`.

.. doctest::

Expand Down Expand Up @@ -1961,7 +1961,7 @@ Function and class definitions
Async and await
^^^^^^^^^^^^^^^

.. class:: AsyncFunctionDef(name, args, body, decorator_list, returns, type_comment)
.. class:: AsyncFunctionDef(name, args, body, decorator_list, returns, type_comment, type_params)

An ``async def`` function definition. Has the same fields as
:class:`FunctionDef`.
Expand Down