gh-133601: Remove deprecated typing.no_type_check_decorator (#133602)

This commit is contained in:
sobolevn 2025-10-21 00:10:44 +03:00 committed by GitHub
parent a752f58d6b
commit e09837fcbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 8 additions and 66 deletions

View file

@ -33,7 +33,7 @@
from typing import is_typeddict, is_protocol
from typing import reveal_type
from typing import dataclass_transform
from typing import no_type_check, no_type_check_decorator
from typing import no_type_check
from typing import Type
from typing import NamedTuple, NotRequired, Required, ReadOnly, TypedDict, NoExtraItems
from typing import IO, TextIO, BinaryIO
@ -6376,35 +6376,6 @@ class F:
for clazz in [C, D, E, F]:
self.assertEqual(get_type_hints(clazz), expected_result)
def test_meta_no_type_check(self):
depr_msg = (
"'typing.no_type_check_decorator' is deprecated "
"and slated for removal in Python 3.15"
)
with self.assertWarnsRegex(DeprecationWarning, depr_msg):
@no_type_check_decorator
def magic_decorator(func):
return func
self.assertEqual(magic_decorator.__name__, 'magic_decorator')
@magic_decorator
def foo(a: 'whatevers') -> {}:
pass
@magic_decorator
class C:
def foo(a: 'whatevers') -> {}:
pass
self.assertEqual(foo.__name__, 'foo')
th = get_type_hints(foo)
self.assertEqual(th, {})
cth = get_type_hints(C.foo)
self.assertEqual(cth, {})
ith = get_type_hints(C().foo)
self.assertEqual(ith, {})
class InternalsTests(BaseTestCase):
def test_collect_parameters(self):