]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-101100: Fix Sphinx warnings in `library/pyclbr.rst` (GH-113739) (#113748)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 5 Jan 2024 19:36:31 +0000 (20:36 +0100)
committerGitHub <noreply@github.com>
Fri, 5 Jan 2024 19:36:31 +0000 (21:36 +0200)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Doc/library/pyclbr.rst
Doc/tools/.nitignore
Doc/whatsnew/3.10.rst

index 1c40ba4838ca75890554ab2d444f229bdd626785..1e9876849b02f3570daeb26768a0a1cf50451c2f 100644 (file)
@@ -58,106 +58,115 @@ of these classes.
 
 Function Objects
 ----------------
-Class :class:`Function` instances describe functions defined by def
-statements.  They have the following attributes:
 
+.. class:: Function
 
-.. attribute:: Function.file
+   Class :class:`!Function` instances describe functions defined by def
+   statements.  They have the following attributes:
 
-   Name of the file in which the function is defined.
 
+   .. attribute:: file
 
-.. attribute:: Function.module
+      Name of the file in which the function is defined.
 
-   The name of the module defining the function described.
 
+   .. attribute:: module
 
-.. attribute:: Function.name
+      The name of the module defining the function described.
 
-   The name of the function.
 
+   .. attribute:: name
 
-.. attribute:: Function.lineno
+      The name of the function.
 
-   The line number in the file where the definition starts.
 
+   .. attribute:: lineno
 
-.. attribute:: Function.parent
+      The line number in the file where the definition starts.
 
-   For top-level functions, None.  For nested functions, the parent.
 
-   .. versionadded:: 3.7
+   .. attribute:: parent
 
+      For top-level functions, ``None``.  For nested functions, the parent.
 
-.. attribute:: Function.children
+      .. versionadded:: 3.7
 
-   A dictionary mapping names to descriptors for nested functions and
-   classes.
 
-   .. versionadded:: 3.7
+   .. attribute:: children
 
+      A :class:`dictionary <dict>` mapping names to descriptors for nested functions and
+      classes.
 
-.. attribute:: Function.is_async
+      .. versionadded:: 3.7
 
-   ``True`` for functions that are defined with the ``async`` prefix, ``False`` otherwise.
 
-   .. versionadded:: 3.10
+   .. attribute:: is_async
+
+      ``True`` for functions that are defined with the
+      :keyword:`async <async def>` prefix, ``False`` otherwise.
+
+      .. versionadded:: 3.10
 
 
 .. _pyclbr-class-objects:
 
 Class Objects
 -------------
-Class :class:`Class` instances describe classes defined by class
-statements.  They have the same attributes as Functions and two more.
+
+.. class:: Class
+
+   Class :class:`!Class` instances describe classes defined by class
+   statements.  They have the same attributes as :class:`Functions <Function>`
+   and two more.
 
 
-.. attribute:: Class.file
+   .. attribute:: file
 
-   Name of the file in which the class is defined.
+      Name of the file in which the class is defined.
 
 
-.. attribute:: Class.module
+   .. attribute:: module
 
-   The name of the module defining the class described.
+      The name of the module defining the class described.
 
 
-.. attribute:: Class.name
+   .. attribute:: name
 
-   The name of the class.
+      The name of the class.
 
 
-.. attribute:: Class.lineno
+   .. attribute:: lineno
 
-   The line number in the file where the definition starts.
+      The line number in the file where the definition starts.
 
 
-.. attribute:: Class.parent
+   .. attribute:: parent
 
-   For top-level classes, None.  For nested classes, the parent.
+      For top-level classes, None.  For nested classes, the parent.
 
-   .. versionadded:: 3.7
+      .. versionadded:: 3.7
 
 
-.. attribute:: Class.children
+   .. attribute:: children
 
-   A dictionary mapping names to descriptors for nested functions and
-   classes.
+      A dictionary mapping names to descriptors for nested functions and
+      classes.
 
-   .. versionadded:: 3.7
+      .. versionadded:: 3.7
 
 
-.. attribute:: Class.super
+   .. attribute:: super
 
-   A list of :class:`Class` objects which describe the immediate base
-   classes of the class being described.  Classes which are named as
-   superclasses but which are not discoverable by :func:`readmodule_ex`
-   are listed as a string with the class name instead of as
-   :class:`Class` objects.
+      A list of :class:`!Class` objects which describe the immediate base
+      classes of the class being described.  Classes which are named as
+      superclasses but which are not discoverable by :func:`readmodule_ex`
+      are listed as a string with the class name instead of as
+      :class:`!Class` objects.
 
 
-.. attribute:: Class.methods
+   .. attribute:: methods
 
-   A dictionary mapping method names to line numbers.  This can be
-   derived from the newer children dictionary, but remains for
-   back-compatibility.
+      A :class:`dictionary <dict>` mapping method names to line numbers.
+      This can be derived from the newer :attr:`children` dictionary,
+      but remains for
+      back-compatibility.
index c0f8aee64aed7cce150c683c2ec5ef1af44f53cb..fe83c25a1c683f6959c323098c46ed1f51fa0b6b 100644 (file)
@@ -78,7 +78,6 @@ Doc/library/pickletools.rst
 Doc/library/platform.rst
 Doc/library/plistlib.rst
 Doc/library/profile.rst
-Doc/library/pyclbr.rst
 Doc/library/pydoc.rst
 Doc/library/pyexpat.rst
 Doc/library/readline.rst
index f4b891e722641de5a745950dbfdd2777a066d59b..83f2da6ca3a944c944ebbb15f22b32f64d8804b3 100644 (file)
@@ -1316,8 +1316,8 @@ pyclbr
 ------
 
 Add an ``end_lineno`` attribute to the ``Function`` and ``Class``
-objects in the tree returned by :func:`pyclbr.readline` and
-:func:`pyclbr.readline_ex`.  It matches the existing (start) ``lineno``.
+objects in the tree returned by :func:`pyclbr.readmodule` and
+:func:`pyclbr.readmodule_ex`.  It matches the existing (start) ``lineno``.
 (Contributed by Aviral Srivastava in :issue:`38307`.)
 
 shelve