mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Add some missing "type" attributes (#200)
This commit is contained in:
committed by
Guido van Rossum
parent
e9efb31aa7
commit
cd12f6e255
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user