Skip to content

[pyupgrade] Stop recommending removed typing.no_type_check_decorator (UP035) - #28475

Merged
ntBre merged 1 commit into
mainfrom
brent/up035-no-type-check-decorator
Sep 10, 2026
Merged

ntBre merged 1 commit into
mainfrom
brent/up035-no-type-check-decorator

Conversation

@ntBre

@ntBre ntBre commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR removes typing_extensions.no_type_check_decorator from 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_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

…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 ntBre added rule Implementing or modifying a lint rule python315 Related to Python 3.15 labels Sep 9, 2026
@ntBre ntBre mentioned this pull request Sep 9, 2026
27 of 32 tasks
@astral-sh-bot

astral-sh-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre
ntBre marked this pull request as ready for review September 9, 2026 21:03
@ntBre
ntBre merged commit 86a2eba into main Sep 10, 2026
50 checks passed
@ntBre
ntBre deleted the brent/up035-no-type-check-decorator branch September 10, 2026 13:12
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python315 Related to Python 3.15 rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants