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

Stubgen: split @abstractproperty #8066

Merged
merged 2 commits into from Dec 11, 2019

Conversation

@TH3CHARLie
Copy link
Contributor

TH3CHARLie commented Dec 3, 2019

resolves #7952

mypy/stubgen.py Show resolved Hide resolved
elif self.refers_to_fullname(name, 'abc.abstractproperty'):
self.add_decorator('property')
self.add_decorator('abc.abstractmethod')
is_abstract = True

This comment has been minimized.

Copy link
@TH3CHARLie

TH3CHARLie Dec 3, 2019

Author Contributor

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

This comment has been minimized.

Copy link
Contributor Author

TH3CHARLie commented Dec 7, 2019

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

Copy link
Collaborator

msullivan left a comment

This looks good to me!

@msullivan msullivan merged commit 63057d8 into python:master Dec 11, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@TH3CHARLie TH3CHARLie deleted the TH3CHARLie:stubgen-split-@abstractproperty branch Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.