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
|
|
@ -139,7 +139,6 @@
|
|||
'Never',
|
||||
'NewType',
|
||||
'no_type_check',
|
||||
'no_type_check_decorator',
|
||||
'NoDefault',
|
||||
'NoExtraItems',
|
||||
'NoReturn',
|
||||
|
|
@ -2623,23 +2622,6 @@ def no_type_check(arg):
|
|||
return arg
|
||||
|
||||
|
||||
def no_type_check_decorator(decorator):
|
||||
"""Decorator to give another decorator the @no_type_check effect.
|
||||
|
||||
This wraps the decorator with something that wraps the decorated
|
||||
function in @no_type_check.
|
||||
"""
|
||||
import warnings
|
||||
warnings._deprecated("typing.no_type_check_decorator", remove=(3, 15))
|
||||
@functools.wraps(decorator)
|
||||
def wrapped_decorator(*args, **kwds):
|
||||
func = decorator(*args, **kwds)
|
||||
func = no_type_check(func)
|
||||
return func
|
||||
|
||||
return wrapped_decorator
|
||||
|
||||
|
||||
def _overload_dummy(*args, **kwds):
|
||||
"""Helper for @overload to raise when called."""
|
||||
raise NotImplementedError(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue