Skip to content

"Attributes" in Numpy-style class docstrings are parsed as Parameters #21

Description

@janfreyberg

Numpy docstrings for classes have an Attributes section:

https://numpydoc.readthedocs.io/en/latest/format.html#class-docstring

However, if I parse a docstring that adheres to it, the Attributes are listed as Parameters:

from docstring_parser import parse, Style

docstring = """Test class

My test class does nothing

Attributes
----------
data : None
  An empty field
"""

parsed_docstring = parse(d, style=Style.numpydoc)

for param in parsed_docstring.params:
    print(param.arg_name)

# outputs:
# 'data'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions