2 from typing import Any, Callable, Iterator, NamedTuple, Pattern, Text, Tuple, TypeVar
4 _C = TypeVar("_C", bound=Callable[..., Any])
5 _Func = TypeVar("_Func", bound=Callable[..., Any])
8 def get_init(cls: type) -> None: ...
10 if sys.version_info >= (3,):
11 from inspect import getfullargspec as getfullargspec, iscoroutinefunction as iscoroutinefunction
13 class FullArgSpec(NamedTuple):
17 defaults: Tuple[Any, ...]
19 kwonlydefaults: dict[str, Any]
20 annotations: dict[str, Any]
21 def iscoroutinefunction(f: Callable[..., Any]) -> bool: ...
22 def getfullargspec(func: Any) -> FullArgSpec: ...
24 if sys.version_info >= (3, 2):
25 from contextlib import _GeneratorContextManager
27 from contextlib import GeneratorContextManager as _GeneratorContextManager
31 _dict = dict # conflicts with attribute name
33 class FunctionMaker(object):
37 defaults: Tuple[Any, ...]
38 kwonlyargs: list[Text]
39 kwonlydefaults: Text | None
40 shortsignature: Text | None
44 annotations: _dict[Text, Any]
46 dict: _dict[Text, Any]
49 func: Callable[..., Any] | None = ...,
50 name: Text | None = ...,
51 signature: Text | None = ...,
52 defaults: Tuple[Any, ...] | None = ...,
53 doc: Text | None = ...,
54 module: Text | None = ...,
55 funcdict: _dict[Text, Any] | None = ...,
57 def update(self, func: Any, **kw: Any) -> None: ...
59 self, src_templ: Text, evaldict: _dict[Text, Any] | None = ..., addsource: bool = ..., **attrs: Any
60 ) -> Callable[..., Any]: ...
66 evaldict: _dict[Text, Any],
67 defaults: Tuple[Any, ...] | None = ...,
68 doc: Text | None = ...,
69 module: Text | None = ...,
70 addsource: bool = ...,
72 ) -> Callable[..., Any]: ...
74 def decorate(func: _Func, caller: Callable[..., Any], extras: Any = ...) -> _Func: ...
76 caller: Callable[..., Any], _func: Callable[..., Any] | None = ...
77 ) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ...
79 class ContextManager(_GeneratorContextManager[_T]):
80 def __call__(self, func: _C) -> _C: ...
82 def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., ContextManager[_T]]: ...
83 def dispatch_on(*dispatch_args: Any) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ...