edxu96 / mgrid

multilayer network for power grid with multiple voltage levels
https://edxu96.github.io/mgrid
GNU General Public License v3.0
4 stars 2 forks source link

Comment as docstring for attributes in dataclass #110

Closed edxu96 closed 3 years ago

edxu96 commented 3 years ago
class Foo:
    """Docstring for class Foo."""

    #: Doc comment for class attribute Foo.bar.
    #: It can have multiple lines.
    bar = 1

    flox = 1.5   #: Doc comment for Foo.flox. One line only.

    baz = 2
    """Docstring for class attribute Foo.baz."""

    def __init__(self):
        #: Doc comment for instance attribute qux.
        self.qux = 3

        self.spam = 4
        """Docstring for instance attribute spam."""