Skip to content

Commit 9f0c731

Browse files
committed
Copy typeshed changes to builtins.pyi.
See python/typeshed#9771 for context. PiperOrigin-RevId: 515480379
1 parent 33110ca commit 9f0c731

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

pytype/stubs/builtins/builtins.pytd

+15-12
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# minimise the diffs we have to maintain here.
33

44
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)
1111

1212
if sys.version_info >= (3, 8):
1313
from typing import SupportsIndex
@@ -23,6 +23,8 @@ _V = TypeVar('_V')
2323
_K2 = TypeVar('_K2')
2424
_V2 = TypeVar('_V2')
2525

26+
_P = ParamSpec('_P')
27+
2628
class _Summable(Protocol):
2729
def __add__(self, __y: _T) -> _T: ...
2830
_SummableT = TypeVar('_SummableT', bound=_Summable)
@@ -269,15 +271,16 @@ class property(object):
269271
def __delete__(self, *args, **kwargs) -> Any: ...
270272

271273
# staticmethod and classmethod are handled in special_builtins.py.
272-
class staticmethod(typing.Callable, Generic[_T]):
274+
class staticmethod(typing.Callable, Generic[_P, _T]):
273275
__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]: ...
276278

277-
class classmethod(typing.Callable, Generic[_T]):
279+
class classmethod(typing.Callable, Generic[_T, _P, _T2]):
278280
__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]: ...
281284

282285
_T_str = TypeVar('_T_str', bound=str)
283286
class str(Sequence[str], Hashable):

0 commit comments

Comments
 (0)