Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow to use Final and ClassVar after python 3.13#18358

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hauntsaninja merged 9 commits intopython:masterfromaliwo:master
Dec 30, 2024

Conversation

@aliwo
Copy link
Contributor

@aliwoaliwo commentedDec 29, 2024
edited
Loading

Hi, Thanks for making a great library! I've been using mypy for years and it saved me from several (possibly happened) accidents!

Description

this PR allows to use Final and ClassVar after python 3.13

I saw thisPR

and I saw recent changes of python 3.13
https://docs.python.org/3/library/typing.html#typing.Final
image
Final now can be nested with ClassVar. so I added a version check!

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Collaborator

@hauntsaninjahauntsaninja left a comment

Choose a reason for hiding this comment

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

Thank you!

code=codes.VALID_TYPE,
)
else:
elifself.options.python_version< (3,13):
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should still error in several of the cases this previously triggered, e.g.def f(x: Final[int]) -> int: ... (grep the test cases forFinal can be only used as an outermost qualifier for examples)

@github-actions

This comment has been minimized.

node.is_classvar=True
analyzed=self.anal_type(s.type)
analyzed=self.anal_type(
s.type,allow_final_in_classvar=self.options.python_version>= (3,13)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this one might be unnecessary? Let me push to your PR

Copy link
Collaborator

@hauntsaninjahauntsaninja left a comment

Choose a reason for hiding this comment

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

Thank you for this improvement!

aliwo reacted with thumbs up emoji
@aliwo
Copy link
ContributorAuthor

@hauntsaninja Thank you very much!

hauntsaninja reacted with hooray emoji

@github-actions
Copy link
Contributor

According tomypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@hauntsaninjahauntsaninja merged commit80e5e8b intopython:masterDec 30, 2024
18 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@hauntsaninjahauntsaninjahauntsaninja approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@aliwo@hauntsaninja@triumph1

[8]ページ先頭

©2009-2025 Movatter.jp