diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 634ff89fd..3ddb55926 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -66,9 +66,17 @@ class classmethod(object): # Special, only valid as a decorator. def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... class type(object): - __bases__ = ... # type: Tuple[type, ...] - __name__ = ... # type: str - __module__ = ... # type: str + __base__: type = ... + __bases__: Tuple[type, ...] = ... + __basicsize__: int = ... + __dict__: Dict[str, Any] = ... + __dictoffset__: int = ... + __flags__: int = ... + __itemsize__: int = ... + __module__: str = ... + __mro__: Tuple[type, ...] = ... + __name__: str = ... + __weakrefoffset__: int = ... @overload def __init__(self, o: object) -> None: ... @@ -81,8 +89,6 @@ class type(object): 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]: ... diff --git a/stdlib/2/builtins.pyi b/stdlib/2/builtins.pyi index 634ff89fd..3ddb55926 100644 --- a/stdlib/2/builtins.pyi +++ b/stdlib/2/builtins.pyi @@ -66,9 +66,17 @@ class classmethod(object): # Special, only valid as a decorator. def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... class type(object): - __bases__ = ... # type: Tuple[type, ...] - __name__ = ... # type: str - __module__ = ... # type: str + __base__: type = ... + __bases__: Tuple[type, ...] = ... + __basicsize__: int = ... + __dict__: Dict[str, Any] = ... + __dictoffset__: int = ... + __flags__: int = ... + __itemsize__: int = ... + __module__: str = ... + __mro__: Tuple[type, ...] = ... + __name__: str = ... + __weakrefoffset__: int = ... @overload def __init__(self, o: object) -> None: ... @@ -81,8 +89,6 @@ class type(object): 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]: ... diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 242ae6d08..d8b47f512 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -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