Skip to content

Ensure type of classmethod is consistent regardless of whether cls is annotated.#87

Merged
dnwpark merged 2 commits intomainfrom
classmethod-type
Feb 7, 2026
Merged

Ensure type of classmethod is consistent regardless of whether cls is annotated.#87
dnwpark merged 2 commits intomainfrom
classmethod-type

Conversation

@dnwpark
Copy link
Contributor

@dnwpark dnwpark commented Feb 6, 2026

For example

class C:
    @classmethod
    def f(cls) -> int: ...
    @classmethod
    def g(cls: type[C]) -> int: ...

The result of GetMemberType on each function would be:

  • f: classmethod[C, tuple[()], int]
  • g: classmethod[type[C], tuple[()], int]

@dnwpark dnwpark requested a review from msullivan February 6, 2026 21:45
@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
python-typemap Ready Ready Preview, Comment Feb 6, 2026 9:45pm

@dnwpark dnwpark merged commit 57f8da3 into main Feb 7, 2026
4 of 5 checks passed
@dnwpark dnwpark deleted the classmethod-type branch February 7, 2026 07:18
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.

2 participants