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

[red-knot] Add support for @classmethods #16305

Merged
merged 7 commits into from
Feb 24, 2025
Merged

[red-knot] Add support for @classmethods #16305

merged 7 commits into from
Feb 24, 2025

Conversation

sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Feb 21, 2025

Summary

Add support for @classmethods.

class C:
    @classmethod
    def f(cls, x: int) -> str:
        return "a"

reveal_type(C.f(1))  # revealed: str

Test Plan

New Markdown tests

@sharkdp sharkdp added the red-knot Multi-file analysis & type inference label Feb 21, 2025
@sharkdp sharkdp changed the title David/classmethods [red-knot] Add support for @classmethods Feb 21, 2025
Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

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

Looks great!

@sharkdp sharkdp merged commit 141ba25 into main Feb 24, 2025
21 checks passed
@sharkdp sharkdp deleted the david/classmethods branch February 24, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants