Skip to content

Comments incorrectly shown in pydoc output for argparse #134109

Description

@serhiy-storchaka

Bug report

pydoc incorrectly shows some comments for argparse:

     |  format_help(self)
     |      # =======================
     |      # Help-formatting methods
     |      # =======================
     |
     |  start_section(self, heading)
     |      # ========================
     |      # Message building methods
     |      # ========================
     |

Comments immediately preceding the object's source code are used if the object has no docstring. But these comments do not describe the following methods. They are just section headers, separating groups of methods. They should be separated by an empty line from the following code.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

3.13bugs and security fixes3.14bugs and security fixes3.15pre-release feature fixes, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions