Skip to content

Commit 2216db9

Browse files
committed
Update docstring_line_width docstring
1 parent 3bc4f20 commit 2216db9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Tools/clinic/libclinic/function.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,12 @@ def methoddef_flags(self) -> str | None:
169169

170170
@property
171171
def docstring_line_width(self) -> int:
172-
"""PEP 8 requires that docstrings are limited to 72 characters:
172+
"""Return the maximum line width for docstring lines.
173173
174-
The Python standard library is conservative and requires
175-
limiting lines to 79 characters (and docstrings to 72).
176-
177-
Methods have an extra level of indentation, so we use 68.
174+
Pydoc adds indentation when displaying functions and methods.
175+
To keep the total width of within 80 characters, we use a
176+
maximum of 76 characters for global functions and classes,
177+
and 72 characters for methods.
178178
"""
179179
if self.cls is not None and not self.kind.new_or_init:
180180
return 72

0 commit comments

Comments
 (0)