Repository navigation
[pyupgrade] Stop recommending removed typing.no_type_check_decorator (UP035) - #28475
Merged
Merged
Conversation
…or` (`UP035`) Summary -- This PR removes `typing_extensions.no_type_check_decorator` from the list of moved members in UP035. As the [docs](https://docs.python.org/3/library/typing.html#typing.no_type_check_decorator) indicate, this decorator has been deprecated since 3.13 and is removed in 3.15, so the rule should just leave it alone. The change is not version-gated because it seemed weird to me to recommend making this change with a target version of 3.12, for example, only for the user to have to change it back when they eventually bump their Python version. I initially thought that `typing_extensions` would continue to backport this, but it appears that they removed it as well: python/typing_extensions#723. I don't think that actually changes how we should handle it, though. Test Plan -- Added a couple of tests showing no diagnostic
|
ntBre
marked this pull request as ready for review
September 9, 2026 21:03
AlexWaygood
approved these changes
Sep 10, 2026
ntBre
added a commit
that referenced
this pull request
Sep 11, 2026
…35`) (#28498) Summary -- If I had realized how small this was, I would have just bundled it with #28475, but this is another tiny change to `UP035` to avoid replacing `typing.ByteString` with `collections.abc.ByteString`, now that both are deprecated. The `typing` variant has been deprecated since 3.9 and the `collections.abc` version since 3.12, and they've now been removed from their respective `__all__`s in 3.15 in preparation for removal in 3.17. The `collections.ByteString` to `collections.abc.ByteString` transformation is retained since `collections.ByteString` was fully removed back in 3.10. Test Plan -- Updated an existing snapshot
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR removes
typing_extensions.no_type_check_decoratorfrom the list of moved members in UP035. As the docs indicate, this decorator has been deprecated since 3.13 and is removed in 3.15, so the rule should just leave it alone.The change is not version-gated because it seemed weird to me to recommend making this change with a target version of 3.12, for example, only for the user to have to change it back when they eventually bump their Python version.
I initially thought that
typing_extensionswould continue to backport this, but it appears that they removed it as well: python/typing_extensions#723. I don't think that actually changes how we should handle it, though.Test Plan
Added a couple of tests showing no diagnostic