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

This commit is contained in:
Semyon Proshev
2017-03-29 20:19:17 +03:00
committed by Guido van Rossum
parent 18cc2cbf8c
commit 8c1690befc
2 changed files with 30 additions and 6 deletions

View File

@@ -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
@@ -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

View File

@@ -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
@@ -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