-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix #8534: autoattribute failed to document a commented attribute in alias class #8540
Conversation
self._datadescriptor = True | ||
else: | ||
# if it's not a data descriptor | ||
self._datadescriptor = False | ||
except ImportError as exc: | ||
if self.isinstanceattribute(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll refactor this implementation at the next step.
…ribute in alias class So far, autoattribute uses "given class name" to fetch comments of uninitialized instance attributes. But pycode expects to use "real" class name on searching attribute comments. This adds UninitializedInstanceAttributeMixin to handle it simply.
5917c6f
to
caa1d1f
Compare
@@ -29,3 +29,6 @@ def __init__(self): | |||
|
|||
class Derived(Class): | |||
attr7: int | |||
|
|||
|
|||
Alias = Class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would not work when this is an alias of Derived
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to work more to support it. So I'll do it on another PR.
Feature or Bugfix
Purpose