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

Instance variable docstrings are lost if the variable is redefined #28

Open
mikecharles opened this issue Feb 13, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@mikecharles
Copy link

commented Feb 13, 2015

It appears that when an instance variable is redefined below its original definition (which includes the docstring), then the docstring gets lost.

For example:

class Test:
    def __init__(self, name=None):
        self.name = 'Mike'
        '''Name of person'''
        self.age = 30
        '''Age of person'''
        self.gender = None
        '''Gender of person'''

produces:

screen shot 2015-02-13 at 3 57 28 pm

while this:

class Test:
    def __init__(self, name=None):
        self.name = 'Mike'
        '''Name of person'''
        self.age = 30
        '''Age of person'''
        self.gender = None
        '''Gender of person'''

        self.name = name
        self.gender = 'Male'

produces:

screen shot 2015-02-13 at 3 58 16 pm

Shouldn't the docstring be locked down once it's found (unless another attached docstring is found)?

@BurntSushi BurntSushi added the bug label Feb 21, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.