Skip to content

Stubtest: verify stub methods or properties are decorated with @final if they are decorated with @final at runtime - #14951

Merged
sobolevn merged 7 commits into
python:masterfrom
AlexWaygood:stubtest-final-methods
Mar 24, 2023
Merged

sobolevn merged 7 commits into
python:masterfrom
AlexWaygood:stubtest-final-methods

Conversation

@AlexWaygood

Copy link
Copy Markdown
Member

This implements most of #14924. The only thing it doesn't implement is verification for overloaded methods decorated with @final -- I tried working on that, but hit #14950.

…l` if they are decorated with `@final` at runtime

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for taking this up! 👍

Comment thread mypy/test/teststubtest.py
Comment thread mypy/test/teststubtest.py
@sobolevn

Copy link
Copy Markdown
Member

I also thing that overloads can easily be ignored at this stage. Because I don't think many users have final overloads in their runtime source code + separate stubs :)

@AlexWaygood
AlexWaygood requested a review from sobolevn March 24, 2023 15:09
@AlexWaygood AlexWaygood added the topic-final PEP 591 label Mar 24, 2023

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@sobolevn
sobolevn merged commit 01a088b into python:master Mar 24, 2023
@AlexWaygood
AlexWaygood deleted the stubtest-final-methods branch March 24, 2023 17:28
@AlexWaygood

Copy link
Copy Markdown
Member Author

Thanks @sobolevn!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants