Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit eb53750

Browse files
hugovkAlexWaygood
andauthoredJan 5, 2024
gh-101100: Fix Sphinx warnings in library/pyclbr.rst (#113739)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
1 parent 5e1916b commit eb53750

File tree

3 files changed

+58
-50
lines changed

3 files changed

+58
-50
lines changed
 

‎Doc/library/pyclbr.rst

+56-47
Original file line numberDiff line numberDiff line change
@@ -58,106 +58,115 @@ of these classes.
5858

5959
Function Objects
6060
----------------
61-
Class :class:`Function` instances describe functions defined by def
62-
statements. They have the following attributes:
6361

62+
.. class:: Function
6463

65-
.. attribute:: Function.file
64+
Class :class:`!Function` instances describe functions defined by def
65+
statements. They have the following attributes:
6666

67-
Name of the file in which the function is defined.
6867

68+
.. attribute:: file
6969

70-
.. attribute:: Function.module
70+
Name of the file in which the function is defined.
7171

72-
The name of the module defining the function described.
7372

73+
.. attribute:: module
7474

75-
.. attribute:: Function.name
75+
The name of the module defining the function described.
7676

77-
The name of the function.
7877

78+
.. attribute:: name
7979

80-
.. attribute:: Function.lineno
80+
The name of the function.
8181

82-
The line number in the file where the definition starts.
8382

83+
.. attribute:: lineno
8484

85-
.. attribute:: Function.parent
85+
The line number in the file where the definition starts.
8686

87-
For top-level functions, None. For nested functions, the parent.
8887

89-
.. versionadded:: 3.7
88+
.. attribute:: parent
9089

90+
For top-level functions, ``None``. For nested functions, the parent.
9191

92-
.. attribute:: Function.children
92+
.. versionadded:: 3.7
9393

94-
A dictionary mapping names to descriptors for nested functions and
95-
classes.
9694

97-
.. versionadded:: 3.7
95+
.. attribute:: children
9896

97+
A :class:`dictionary <dict>` mapping names to descriptors for nested functions and
98+
classes.
9999

100-
.. attribute:: Function.is_async
100+
.. versionadded:: 3.7
101101

102-
``True`` for functions that are defined with the ``async`` prefix, ``False`` otherwise.
103102

104-
.. versionadded:: 3.10
103+
.. attribute:: is_async
104+
105+
``True`` for functions that are defined with the
106+
:keyword:`async <async def>` prefix, ``False`` otherwise.
107+
108+
.. versionadded:: 3.10
105109

106110

107111
.. _pyclbr-class-objects:
108112

109113
Class Objects
110114
-------------
111-
Class :class:`Class` instances describe classes defined by class
112-
statements. They have the same attributes as Functions and two more.
115+
116+
.. class:: Class
117+
118+
Class :class:`!Class` instances describe classes defined by class
119+
statements. They have the same attributes as :class:`Functions <Function>`
120+
and two more.
113121

114122

115-
.. attribute:: Class.file
123+
.. attribute:: file
116124

117-
Name of the file in which the class is defined.
125+
Name of the file in which the class is defined.
118126

119127

120-
.. attribute:: Class.module
128+
.. attribute:: module
121129

122-
The name of the module defining the class described.
130+
The name of the module defining the class described.
123131

124132

125-
.. attribute:: Class.name
133+
.. attribute:: name
126134

127-
The name of the class.
135+
The name of the class.
128136

129137

130-
.. attribute:: Class.lineno
138+
.. attribute:: lineno
131139

132-
The line number in the file where the definition starts.
140+
The line number in the file where the definition starts.
133141

134142

135-
.. attribute:: Class.parent
143+
.. attribute:: parent
136144

137-
For top-level classes, None. For nested classes, the parent.
145+
For top-level classes, None. For nested classes, the parent.
138146

139-
.. versionadded:: 3.7
147+
.. versionadded:: 3.7
140148

141149

142-
.. attribute:: Class.children
150+
.. attribute:: children
143151

144-
A dictionary mapping names to descriptors for nested functions and
145-
classes.
152+
A dictionary mapping names to descriptors for nested functions and
153+
classes.
146154

147-
.. versionadded:: 3.7
155+
.. versionadded:: 3.7
148156

149157

150-
.. attribute:: Class.super
158+
.. attribute:: super
151159

152-
A list of :class:`Class` objects which describe the immediate base
153-
classes of the class being described. Classes which are named as
154-
superclasses but which are not discoverable by :func:`readmodule_ex`
155-
are listed as a string with the class name instead of as
156-
:class:`Class` objects.
160+
A list of :class:`!Class` objects which describe the immediate base
161+
classes of the class being described. Classes which are named as
162+
superclasses but which are not discoverable by :func:`readmodule_ex`
163+
are listed as a string with the class name instead of as
164+
:class:`!Class` objects.
157165

158166

159-
.. attribute:: Class.methods
167+
.. attribute:: methods
160168

161-
A dictionary mapping method names to line numbers. This can be
162-
derived from the newer children dictionary, but remains for
163-
back-compatibility.
169+
A :class:`dictionary <dict>` mapping method names to line numbers.
170+
This can be derived from the newer :attr:`children` dictionary,
171+
but remains for
172+
back-compatibility.

‎Doc/tools/.nitignore

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ Doc/library/pickletools.rst
6767
Doc/library/platform.rst
6868
Doc/library/plistlib.rst
6969
Doc/library/profile.rst
70-
Doc/library/pyclbr.rst
7170
Doc/library/pydoc.rst
7271
Doc/library/pyexpat.rst
7372
Doc/library/readline.rst

‎Doc/whatsnew/3.10.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1316,8 +1316,8 @@ pyclbr
13161316
------
13171317
13181318
Add an ``end_lineno`` attribute to the ``Function`` and ``Class``
1319-
objects in the tree returned by :func:`pyclbr.readline` and
1320-
:func:`pyclbr.readline_ex`. It matches the existing (start) ``lineno``.
1319+
objects in the tree returned by :func:`pyclbr.readmodule` and
1320+
:func:`pyclbr.readmodule_ex`. It matches the existing (start) ``lineno``.
13211321
(Contributed by Aviral Srivastava in :issue:`38307`.)
13221322
13231323
shelve

0 commit comments

Comments
 (0)
Please sign in to comment.