Skip to content

Commit

Permalink
Copy typeshed changes to builtins.pyi.
Browse files Browse the repository at this point in the history
See python/typeshed#9771 for context.

PiperOrigin-RevId: 515480379
  • Loading branch information
rchen152 committed Mar 11, 2023
1 parent 33110ca commit 9f0c731
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions pytype/stubs/builtins/builtins.pytd
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# minimise the diffs we have to maintain here.

from typing import (
AbstractSet, Any, AsyncGenerator, Awaitable, BinaryIO, Callable, Coroutine,
Dict, FrozenSet, Generator, Generic, Hashable, IO, ItemsView, Iterable,
Iterator, KeysView, List, Literal, Mapping, MutableSequence, Optional,
overload, Protocol, Reversible, Sequence, Set, Sized, SupportsAbs,
SupportsBytes, SupportsComplex, SupportsFloat, SupportsInt, TextIO, Tuple,
Type, Union, ValuesView)
AbstractSet, Any, AsyncGenerator, Awaitable, BinaryIO, Callable,
Concatenate, Coroutine, Dict, FrozenSet, Generator, Generic, Hashable, IO,
ItemsView, Iterable, Iterator, KeysView, List, Literal, Mapping,
MutableSequence, Optional, overload, ParamSpec, Protocol, Reversible,
Sequence, Set, Sized, SupportsAbs, SupportsBytes, SupportsComplex,
SupportsFloat, SupportsInt, TextIO, Tuple, Type, Union, ValuesView)

if sys.version_info >= (3, 8):
from typing import SupportsIndex
Expand All @@ -23,6 +23,8 @@ _V = TypeVar('_V')
_K2 = TypeVar('_K2')
_V2 = TypeVar('_V2')

_P = ParamSpec('_P')

class _Summable(Protocol):
def __add__(self, __y: _T) -> _T: ...
_SummableT = TypeVar('_SummableT', bound=_Summable)
Expand Down Expand Up @@ -269,15 +271,16 @@ class property(object):
def __delete__(self, *args, **kwargs) -> Any: ...

# staticmethod and classmethod are handled in special_builtins.py.
class staticmethod(typing.Callable, Generic[_T]):
class staticmethod(typing.Callable, Generic[_P, _T]):
__slots__ = []
def __init__(self: staticmethod[_T], __f: Callable[..., _T]) -> None: ...
def __get__(self, __obj: _T2 | None, __type: Type[_T2] | None = ...) -> Callable[..., _T]: ...
def __init__(self: staticmethod[_T], __f: Callable[_P, _T]) -> None: ...
def __get__(self, __obj: _T2 | None, __type: Type[_T2] | None = ...) -> Callable[_P, _T]: ...

class classmethod(typing.Callable, Generic[_T]):
class classmethod(typing.Callable, Generic[_T, _P, _T2]):
__slots__ = []
def __init__(self: classmethod[_T], __f: Callable[..., _T]) -> None: ...
def __get__(self, __obj: _T2 | None, __type: Type[_T2] | None = ...) -> Callable[..., _T]: ...
def __init__(self: classmethod[_T2],
__f: Callable[Concatenate[_T, _P], _T2]) -> None: ...
def __get__(self, __obj: _T3 | None, __type: Type[_T3] | None = ...) -> Callable[_P, _T2]: ...

_T_str = TypeVar('_T_str', bound=str)
class str(Sequence[str], Hashable):
Expand Down

0 comments on commit 9f0c731

Please sign in to comment.