Skip to content

Commit

Permalink
DO NOT MERGE make classmethod and staticmethod generic.
Browse files Browse the repository at this point in the history
  • Loading branch information
rchen152 committed Jul 2, 2021
1 parent 2e2fcbf commit 6ca00db
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pytype/stubs/builtins/3/builtins.pytd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ _NUMBER = TypeVar('_NUMBER', bound=complex)
# See b/142884093. We redefine AnyStr rather than importing it to avoid pytype
# mistakenly treating it as a public builtin.
_AnyStr = TypeVar('_AnyStr', bytes, str)
_FuncT = TypeVar("_FuncT", bound=Callable[..., Any])

# isinstance() and issubclass() can take a type or an arbitrarily nested
# tuple of types. This adds support for a few levels; in theory we want
Expand Down Expand Up @@ -207,15 +208,15 @@ class property(object):
def __delete__(self, *args, **kwargs) -> Any: ...

# staticmethod and classmethod are handled in special_builtins.py.
class staticmethod(typing.Callable):
class staticmethod(typing.Callable, Generic[_FuncT]):
__slots__ = []
def __init__(self, func) -> NoneType: ...
def __get__(self, *args, **kwargs) -> Any: ...
def __init__(self, __f: _FuncT) -> NoneType: ...
def __get__(self, *args, **kwargs) -> _FuncT: ...

class classmethod(typing.Callable):
class classmethod(typing.Callable, Generic[_T]):
__slots__ = []
def __init__(self, func) -> NoneType: ...
def __get__(self, *args, **kwargs) -> Any: ...
def __init__(self, __f: Callable[..., _T]) -> NoneType: ...
def __get__(self, *args, **kwargs) -> Callable[..., _T]: ...

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

0 comments on commit 6ca00db

Please sign in to comment.