KEMBAR78
Stubgen: split @abstractproperty by TH3CHARLie · Pull Request #8066 · python/mypy · GitHub
Skip to content

Conversation

@TH3CHARLie
Copy link
Collaborator

@TH3CHARLie TH3CHARLie commented Dec 3, 2019

resolves #7952

elif self.refers_to_fullname(name, 'abc.abstractproperty'):
self.add_decorator('property')
self.add_decorator('abc.abstractmethod')
is_abstract = True
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to be more specific about here. (The previous commit has incorrect tests)
I intentionally did not require_name in import_tracker. This is because is_abstract will be set and abc will be imported, so directly add abc.abstractmethod would work. And as shown in testcase: testAbstractProperty3_semanal, if the imported abstractproperty is aliased, to properly split would have to modify code in import_tracker, which IMO is not necessary since using abc.abstractmethod already achieves purposes

@TH3CHARLie TH3CHARLie changed the title sutbgen: split @abstractproperty Stubgen: split @abstractproperty Dec 3, 2019
@TH3CHARLie
Copy link
Collaborator Author

@JukkaL Would you please review this since it may be a followup of #7921

Copy link
Collaborator

@msullivan msullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

@msullivan msullivan merged commit 63057d8 into python:master Dec 11, 2019
@TH3CHARLie TH3CHARLie deleted the stubgen-split-@abstractproperty branch December 12, 2019 00:42
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

Successfully merging this pull request may close these issues.

stubgen: split @abstractproperty

2 participants