mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Use paramspec in no_type_check_decorator (#5942)
This commit is contained in:
@@ -2,7 +2,7 @@ import collections # Needed by aliases like DefaultDict, see mypy issue 2986
|
||||
import sys
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from types import BuiltinFunctionType, CodeType, FrameType, FunctionType, MethodType, ModuleType, TracebackType
|
||||
from typing_extensions import Literal as _Literal
|
||||
from typing_extensions import Literal as _Literal, ParamSpec as _ParamSpec
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from types import MethodDescriptorType, MethodWrapperType, WrapperDescriptorType
|
||||
@@ -36,6 +36,7 @@ class _SpecialForm:
|
||||
def __getitem__(self, typeargs: Any) -> object: ...
|
||||
|
||||
_F = TypeVar("_F", bound=Callable[..., Any])
|
||||
_P = _ParamSpec("_P")
|
||||
|
||||
def overload(func: _F) -> _F: ...
|
||||
|
||||
@@ -99,7 +100,7 @@ _T_contra = TypeVar("_T_contra", contravariant=True) # Ditto contravariant.
|
||||
_TC = TypeVar("_TC", bound=Type[object])
|
||||
|
||||
def no_type_check(arg: _F) -> _F: ...
|
||||
def no_type_check_decorator(decorator: _F) -> _F: ...
|
||||
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ... # type: ignore
|
||||
|
||||
# Type aliases and type constructors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user