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

[pyupgrade] Ignore is_typeddict and TypedDict for deprecated-import (UP035) #15800

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

InSyncWithFoo
Copy link
Contributor

@InSyncWithFoo InSyncWithFoo commented Jan 29, 2025

Summary

Resolves #15780.

is_typeddict and TypedDict are now listed as known exceptions to the rule. The former will presumably stay until 3.9 reaches its end-of-life circa this October.

Test Plan

cargo nextest run and cargo insta test.

Copy link
Contributor

github-actions bot commented Jan 29, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@AlexWaygood AlexWaygood self-assigned this Jan 29, 2025
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks! Could you also move "TypedDict" out of the TYPING_EXTENSIONS_TO_TYPING_313 list? Even on Python 3.13, typing_extensions.TypedDict is different to typing.TypedDict in the latest release of typing_extensions. (It provides an implementation of a version of PEP 728, which hasn't yet been accepted, and therefore hasn't yet been incorporated into typing.TypedDict)

@InSyncWithFoo InSyncWithFoo changed the title [pyupgrade] Ignore is_typeddict (UP035) [pyupgrade] Ignore is_typeddict and TypedDict (UP035) Jan 29, 2025
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks!

@AlexWaygood AlexWaygood changed the title [pyupgrade] Ignore is_typeddict and TypedDict (UP035) [pyupgrade] Ignore is_typeddict and TypedDict for deprecated-import (UP035) Jan 29, 2025
@AlexWaygood AlexWaygood merged commit d151ca8 into astral-sh:main Jan 29, 2025
21 checks passed
@InSyncWithFoo InSyncWithFoo deleted the UP035 branch January 29, 2025 18:27
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.

UP035 recommends change that changes runtime behavior for is_typeddict
2 participants