Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes duplicated when documented in Python class docstring #146

Closed
AWhetter opened this issue Jul 26, 2018 · 1 comment
Closed

Attributes duplicated when documented in Python class docstring #146

AWhetter opened this issue Jul 26, 2018 · 1 comment

Comments

@AWhetter
Copy link
Collaborator

AWhetter commented Jul 26, 2018

If an attribute is documented in the class docstring and also assigned to in __init__, the attribute is documented twice. It should get documented only once. If it is documented in both places, I think it is fine for the choice of which docstring to use to be arbitrary.

class MyClass:
    """My class does stuff.

    Attributes:
        thing (object): A thing.
    """
    def __init__(self):
        self.thing = 5
@AWhetter
Copy link
Collaborator Author

I'm closing this because we can't get around it without parsing the docstring, which isn't something that we want to get into.

AWhetter added a commit that referenced this issue Aug 13, 2018
Fixes #146
Also fixed duplicates when a property is set in __init__.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant