Add missing attributes of type (#2544)

All these attributes can be seen when using `dir(type)`.

In the future we should be discussing if certain methods on object (like
__eq__) should really be there. IMO this should be defined on type where it
actually also appears when using `dir`.
This commit is contained in:
Dave Halter
2018-12-21 05:01:40 +01:00
committed by Jelle Zijlstra
parent 9b5976e15b
commit 2cedbc7d63
3 changed files with 37 additions and 16 deletions

View File

@@ -75,12 +75,19 @@ class classmethod: # Special, only valid as a decorator.
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ...
class type:
__bases__ = ... # type: Tuple[type, ...]
__name__ = ... # type: str
__qualname__ = ... # type: str
__module__ = ... # type: str
__dict__ = ... # type: Dict[str, Any]
__mro__ = ... # type: Tuple[type, ...]
__base__: type = ...
__bases__: Tuple[type, ...] = ...
__basicsize__: int = ...
__dict__: Dict[str, Any] = ...
__dictoffset__: int = ...
__flags__: int = ...
__itemsize__: int = ...
__module__: str = ...
__mro__: Tuple[type, ...] = ...
__name__: str = ...
__qualname__: str = ...
__text_signature__: Optional[str] = ...
__weakrefoffset__: int = ...
@overload
def __init__(self, o: object) -> None: ...
@@ -97,6 +104,8 @@ class type:
def mro(self) -> List[type]: ...
def __instancecheck__(self, instance: Any) -> bool: ...
def __subclasscheck__(self, subclass: type) -> bool: ...
@classmethod
def __prepare__(metacls, __name: str, __bases: Tuple[type, ...], **kwds: Any) -> Mapping[str, Any]: ...
class super:
@overload