2
2
# minimise the diffs we have to maintain here.
3
3
4
4
from typing import (
5
- AbstractSet, Any, AsyncGenerator, Awaitable, BinaryIO, Callable, Coroutine,
6
- Dict, FrozenSet, Generator, Generic, Hashable, IO, ItemsView, Iterable ,
7
- Iterator, KeysView, List, Literal, Mapping, MutableSequence, Optional ,
8
- overload, Protocol, Reversible, Sequence, Set, Sized, SupportsAbs ,
9
- SupportsBytes, SupportsComplex, SupportsFloat, SupportsInt, TextIO, Tuple ,
10
- Type, Union, ValuesView)
5
+ AbstractSet, Any, AsyncGenerator, Awaitable, BinaryIO, Callable,
6
+ Concatenate, Coroutine, Dict, FrozenSet, Generator, Generic, Hashable, IO,
7
+ ItemsView, Iterable, Iterator, KeysView, List, Literal, Mapping,
8
+ MutableSequence, Optional, overload, ParamSpec, Protocol, Reversible ,
9
+ Sequence, Set, Sized, SupportsAbs, SupportsBytes, SupportsComplex ,
10
+ SupportsFloat, SupportsInt, TextIO, Tuple, Type, Union, ValuesView)
11
11
12
12
if sys.version_info >= (3, 8):
13
13
from typing import SupportsIndex
@@ -23,6 +23,8 @@ _V = TypeVar('_V')
23
23
_K2 = TypeVar('_K2')
24
24
_V2 = TypeVar('_V2')
25
25
26
+ _P = ParamSpec('_P')
27
+
26
28
class _Summable(Protocol):
27
29
def __add__(self, __y: _T) -> _T: ...
28
30
_SummableT = TypeVar('_SummableT', bound=_Summable)
@@ -269,15 +271,16 @@ class property(object):
269
271
def __delete__(self, *args, **kwargs) -> Any: ...
270
272
271
273
# staticmethod and classmethod are handled in special_builtins.py.
272
- class staticmethod(typing.Callable, Generic[_T]):
274
+ class staticmethod(typing.Callable, Generic[_P, _T]):
273
275
__slots__ = []
274
- def __init__(self: staticmethod[_T], __f: Callable[... , _T]) -> None: ...
275
- def __get__(self, __obj: _T2 | None, __type: Type[_T2] | None = ...) -> Callable[... , _T]: ...
276
+ def __init__(self: staticmethod[_T], __f: Callable[_P , _T]) -> None: ...
277
+ def __get__(self, __obj: _T2 | None, __type: Type[_T2] | None = ...) -> Callable[_P , _T]: ...
276
278
277
- class classmethod(typing.Callable, Generic[_T]):
279
+ class classmethod(typing.Callable, Generic[_T, _P, _T2 ]):
278
280
__slots__ = []
279
- def __init__(self: classmethod[_T], __f: Callable[..., _T]) -> None: ...
280
- def __get__(self, __obj: _T2 | None, __type: Type[_T2] | None = ...) -> Callable[..., _T]: ...
281
+ def __init__(self: classmethod[_T2],
282
+ __f: Callable[Concatenate[_T, _P], _T2]) -> None: ...
283
+ def __get__(self, __obj: _T3 | None, __type: Type[_T3] | None = ...) -> Callable[_P, _T2]: ...
281
284
282
285
_T_str = TypeVar('_T_str', bound=str)
283
286
class str(Sequence[str], Hashable):
0 commit comments