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

Enforce that @override or @final appear only on first overload #9747

Open
erictraut opened this issue Jan 23, 2025 · 0 comments
Open

Enforce that @override or @final appear only on first overload #9747

erictraut opened this issue Jan 23, 2025 · 0 comments
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working spec compliance

Comments

@erictraut
Copy link
Collaborator

erictraut commented Jan 23, 2025

The new proposed typing spec update for overloads proposes that if an overload has no implementation (e.g. it's in a stub, protocol or ABC), then a @final or @override decorator should appear only on the first overloaded signature and not on subsequent ones.

If an implementation is present, the @final and @override must be placed only on the implementation and not on any of the overloads.

Pyright should enforce these rules.

@erictraut erictraut added bug Something isn't working spec compliance labels Jan 23, 2025
erictraut added a commit that referenced this issue Jan 25, 2025
… for `@final` and `@override` applied to an overload. This addresses #9747.
erictraut added a commit that referenced this issue Jan 25, 2025
… for `@final` and `@override` applied to an overload. This addresses #9747. (#9757)
@erictraut erictraut added the addressed in next version Issue is fixed and will appear in next published version label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working spec compliance
Projects
None yet
Development

No branches or pull requests

1 participant