Remove no_type_check_decorator from _typing_names - #723
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #723 +/- ##
==========================================
- Coverage 97.38% 96.74% -0.64%
==========================================
Files 3 3
Lines 7689 7690 +1
==========================================
- Hits 7488 7440 -48
- Misses 201 250 +49
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
This is technically a breaking change. I wonder whether we shouldn't add a small stub for this for Python 3.15+, so that importing that name doesn't break. |
|
Since this was never implemented by any type checkers as far as I know, we could even skip the import for all Python versions and just add something like (pseudo-code): def __getattr__(name):
if name == "no_type_check_decorator":
# print deprecation warning
return lambda f: for just @deprecated("...")
def no_type_check_decorator(f):
return f |
|
I think this is fine as is. It's OK if behavior changes depending on the Python version. |
It appears coverage did not run on 3.14 hence the unexpected misses. |
hroncok
left a comment
There was a problem hiding this comment.
This makes the test pass.
…or` (`UP035`) (#28475) 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
Resolves: #700
Tested with 3.15.0a4