Add some missing "type" attributes (#200)

This commit is contained in:
Jakub Stasiak
2016-05-14 19:18:36 +02:00
committed by Guido van Rossum
parent e9efb31aa7
commit cd12f6e255
2 changed files with 14 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ class object:
def __hash__(self) -> int: ...
class type:
__bases__ = ... # type: Tuple[type, ...]
__name__ = ... # type: str
__module__ = ... # type: str
__dict__ = ... # type: Dict[unicode, Any]
@@ -55,6 +56,13 @@ class type:
def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ...
def __call__(self, *args: Any, **kwds: Any) -> Any: ...
# Only new-style classes
__mro__ = ... # type: Tuple[type, ...]
# Note: the documentation doesnt specify what the return type is, the standard
# implementation seems to be returning a list.
def mro(self) -> List[type]: ...
def __subclasses__(self) -> List[type]: ...
class int(SupportsInt, SupportsFloat, SupportsAbs[int]):
@overload
def __init__(self) -> None: ...

View File

@@ -40,10 +40,12 @@ class object:
def __hash__(self) -> int: ...
class type:
__bases__ = ... # type: Tuple[type, ...]
__name__ = ... # type: str
__qualname__ = ... # type: str
__module__ = ... # type: str
__dict__ = ... # type: Dict[str, Any]
__mro__ = ... # type: Tuple[type, ...]
@overload
def __init__(self, o: object) -> None: ...
@@ -54,6 +56,10 @@ class type:
@overload
def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ...
def __call__(self, *args: Any, **kwds: Any) -> Any: ...
def __subclasses__(self) -> List[type]: ...
# Note: the documentation doesnt specify what the return type is, the standard
# implementation seems to be returning a list.
def mro(self) -> List[type]: ...
class int(SupportsInt, SupportsFloat, SupportsAbs[int]):
def __init__(self, x: Union[SupportsInt, str, bytes] = None, base: int = None) -> None: ...