spadarian / docblock-python

Atom plugin to insert documentation blocks for python functions
GNU General Public License v2.0
22 stars 9 forks source link

issue generating docblock when class doesn't have __init__() fn #47

Closed pschiffe closed 4 years ago

pschiffe commented 4 years ago

Hello,

first of all, thanks for a very fine atom package!

I've noticed the following issue, when a python class is missing a __init__() fn. In the following example I've generated docblock in the same way for both classes. The first one was generated correctly according to my settings:

class AA:
    '''Short summary.

    Attributes
    ----------
    attr1 : type
        Description of attribute `attr1`.
    attr2 : type
        Description of attribute `attr2`.

    '''
    attr1 = 1
    attr2 = 2

    def __init__(self):
        return True

    def f1(self):
        return True

class BB:
    """Short summary."""
    attr1 = 1
    attr2 = 2

    def f1(self):
        return True
pschiffe commented 4 years ago

Thank you!

spadarian commented 4 years ago

You are welcome. Thanks for reporting the issue!