Chilipp / autodocsumm

Extending your autodoc API docs with a summary
Apache License 2.0
48 stars 14 forks source link

Instance variable not shown correctly #8

Closed maeddlae closed 5 years ago

maeddlae commented 5 years ago

Description Instance variable is not shown correctly:

Example

class Example():
    """
    class documentation
    """
    class_variable = 12 #: This is a classvariable

    def __init__(self):
        """
        constructor doc
        """
        self.instance_variable = 34 #: This is an instance variable

Generated output: image

Setup:

Chilipp commented 5 years ago

Good point, yes, that is at the moment not working. The only workaround is to create a class_variable and override it in the corresponding instance

class Example():
    """
    class documentation
    """
    class_variable = 12 #: This is a classvariable

    instance_variable = None #: This is an instance variable and will be overwritten

    def __init__(self):
        """
        constructor doc
        """
        self.instance_variable = 34 #: This is an instance variable

But you are right, since autodoc is able to put the instance_variable here, autodocsumm should as well

maeddlae commented 5 years ago

Do you plan to fix this in the near future? I am asking because autodocsumm perfectly fits my needs. But showing the attributes is critical for me..

Chilipp commented 5 years ago

Yes, I will work on it before Sunday. I don't think it should be too difficult.

maeddlae commented 5 years ago

Great, thanks a lot. Then I will wait for your update:-)