Skip to content

Update stubs for classmethod and staticmethod in both Pythons. #1089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions stdlib/2/__builtin__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ _T4 = TypeVar('_T4')
_T5 = TypeVar('_T5')
_TT = TypeVar('_TT', bound='type')

class staticmethod: ... # Special, only valid as a decorator.
class classmethod: ... # Special, only valid as a decorator.

class object:
__doc__ = ... # type: Optional[str]
__class__ = ... # type: type
Expand All @@ -49,6 +46,20 @@ class object:
def __reduce__(self) -> tuple: ...
def __reduce_ex__(self, protocol: int) -> tuple: ...

class staticmethod(object): # Special, only valid as a decorator.
__func__ = ... # type: function

def __init__(self, f: function) -> None: ...
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
def __get__(self, obj: _T, type: Optional[Type[_T]]=...) -> function: ...

class classmethod(object): # Special, only valid as a decorator.
__func__ = ... # type: function

def __init__(self, f: function) -> None: ...
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
def __get__(self, obj: _T, type: Optional[Type[_T]]=...) -> function: ...

class type(object):
__bases__ = ... # type: Tuple[type, ...]
__name__ = ... # type: str
Expand Down
19 changes: 16 additions & 3 deletions stdlib/3/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ _T4 = TypeVar('_T4')
_T5 = TypeVar('_T5')
_TT = TypeVar('_TT', bound='type')

class staticmethod: ... # Special, only valid as a decorator.
class classmethod: ... # Special, only valid as a decorator.

class object:
__doc__ = ... # type: Optional[str]
__class__ = ... # type: type
Expand Down Expand Up @@ -57,6 +54,22 @@ class object:
if sys.version_info >= (3, 6):
def __init_subclass__(cls) -> None: ...

class staticmethod: # Special, only valid as a decorator.
__func__ = ... # type: function
__isabstractmethod__ = ... # type: bool

def __init__(self, f: function) -> None: ...
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
def __get__(self, obj: _T, type: Optional[Type[_T]]=...) -> function: ...

class classmethod: # Special, only valid as a decorator.
__func__ = ... # type: function
__isabstractmethod__ = ... # type: bool

def __init__(self, f: function) -> None: ...
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
def __get__(self, obj: _T, type: Optional[Type[_T]]=...) -> function: ...

class type:
__bases__ = ... # type: Tuple[type, ...]
__name__ = ... # type: str
Expand Down