Skip to content

Python: Two classes in one file, second class documentation block copied into its class method block #9158

@spluttflob

Description

@spluttflob

Describe the bug
A Python file contains two classes, each with some methods, all documented with docstrings. Documentation is generated correctly for the first class. The class documentation block for the second class in the file is copied into the block for the first method belonging to the second class.

Expected behavior
The class documentation for each class should not be copied into the function documentation block for any method.

To Reproduce
Please see attached .zip, in which the following triggers the apparent bug:

class Alpha:
    """! The class documentation of the first class. """
    def __init__(self):
        """! The first class's initializer. """
    def moo(self):
        """! Perhaps make a bovine sound? """
        
class Beta:
    """! The class documentation of the second class. """
    def __init__(self):
        """! The second class's constructor. """
    def meow(self):
        """! Make a feline sound, but not purring. """

Screenshot
The errant result:
doxy-bug

Version

  • Found on 1.8.17 running on Ubuntu 20.04.4 LTS, installed from Ubuntu repositories.
  • Verified on freshly compiled 1.9.4.

The Zip
doxy_bug.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions