Skip to content

Commit 4cfefdc

Browse files
committed
add no_type_check_decorator stub for #2884
1 parent 107eaeb commit 4cfefdc

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

stdlib/2/typing.pyi

+6-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ overload = object()
1111
Any = object()
1212
TypeVar = object()
1313
_promote = object()
14-
no_type_check = object()
1514

1615
class _SpecialForm(object):
1716
def __getitem__(self, typeargs: Any) -> object: ...
@@ -36,6 +35,10 @@ class GenericMeta(type): ...
3635
# distinguish the None type from the None value.
3736
NoReturn = Union[None]
3837

38+
_C = TypeVar("_C", bound=Callable[..., Any])
39+
no_type_check = object()
40+
def no_type_check_decorator(decorator: _C) -> _C: ...
41+
3942
# Type aliases and type constructors
4043

4144
class TypeAlias:
@@ -69,7 +72,8 @@ _KT_co = TypeVar('_KT_co', covariant=True) # Key type covariant containers.
6972
_VT_co = TypeVar('_VT_co', covariant=True) # Value type covariant containers.
7073
_T_contra = TypeVar('_T_contra', contravariant=True) # Ditto contravariant.
7174
_TC = TypeVar('_TC', bound=Type[object])
72-
_C = TypeVar("_C", bound=Callable[..., Any])
75+
# _C is now declared earlier for no_type_check_decorator
76+
# _C = TypeVar("_C", bound=Callable[..., Any])
7377

7478
def runtime_checkable(cls: _TC) -> _TC: ...
7579

stdlib/3/typing.pyi

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ overload = object()
1212
Any = object()
1313
TypeVar = object()
1414
_promote = object()
15-
no_type_check = object()
1615

1716
class _SpecialForm:
1817
def __getitem__(self, typeargs: Any) -> Any: ...
@@ -38,6 +37,10 @@ class GenericMeta(type): ...
3837
# distinguish the None type from the None value.
3938
NoReturn = Union[None]
4039

40+
_C = TypeVar("_C", bound=Callable[..., Any])
41+
no_type_check = object()
42+
def no_type_check_decorator(decorator: _C) -> _C: ...
43+
4144
# Type aliases and type constructors
4245

4346
class TypeAlias:
@@ -75,7 +78,8 @@ _KT_co = TypeVar('_KT_co', covariant=True) # Key type covariant containers.
7578
_VT_co = TypeVar('_VT_co', covariant=True) # Value type covariant containers.
7679
_T_contra = TypeVar('_T_contra', contravariant=True) # Ditto contravariant.
7780
_TC = TypeVar('_TC', bound=Type[object])
78-
_C = TypeVar("_C", bound=Callable[..., Any])
81+
# _C is now declared earlier for no_type_check_decorator
82+
# _C = TypeVar("_C", bound=Callable[..., Any])
7983

8084
def runtime_checkable(cls: _TC) -> _TC: ...
8185

0 commit comments

Comments
 (0)