Skip to content

How should class variables be documented? #612

Open
@lagru

Description

@lagru

I'm currently dealing with the case that I want to document a class variable with numpydoc while hacking on docstub. How would I do that? Concretely

class Foo:
    """Short summary.

    Attributes
    ----------
    my_instance_var : int
    """

    my_class_var = 3

    def __init__(self):
        my_instance_var = 2

Should I add this to the existing "Attributes" section, perhaps typed with typing.ClassVar[int] or int, class variable?

@stefanv suggested that custom sections #202 might be a way to address this as well.

Apologies if I missed an existing discussion or documentation about this; I looked but didn't find one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions