mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-133601: Remove deprecated typing.no_type_check_decorator (#133602)
This commit is contained in:
parent
a752f58d6b
commit
e09837fcbf
8 changed files with 8 additions and 66 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue