mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Add special methods for object (#774)
* Add special methods for object * Add __format__ to 2/__builtin__.pyi too * Remove redundant __format__ from float.
This commit is contained in:
@@ -39,6 +39,9 @@ class object:
|
||||
def __str__(self) -> str: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __format__(self, format_spec: str) -> str: ...
|
||||
def __getattribute__(self, name: str) -> Any: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
|
||||
class type:
|
||||
__bases__ = ... # type: Tuple[type, ...]
|
||||
@@ -162,7 +165,6 @@ class float(SupportsFloat, SupportsInt, SupportsAbs[float]):
|
||||
def __float__(self) -> float: ...
|
||||
def __abs__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __format__(self, format_spec: AnyStr) -> str: ...
|
||||
|
||||
class complex(SupportsAbs[float]):
|
||||
@overload
|
||||
|
||||
@@ -42,6 +42,9 @@ class object:
|
||||
def __str__(self) -> str: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __format__(self, format_spec: str) -> str: ...
|
||||
def __getattribute__(self, name: str) -> Any: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
|
||||
class type:
|
||||
__bases__ = ... # type: Tuple[type, ...]
|
||||
@@ -151,7 +154,6 @@ class float(SupportsFloat, SupportsInt, SupportsAbs[float]):
|
||||
def __float__(self) -> float: ...
|
||||
def __abs__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __format__(self, format_spec: str) -> str: ...
|
||||
|
||||
class complex(SupportsAbs[float]):
|
||||
@overload
|
||||
@@ -639,7 +641,6 @@ class enumerate(Iterator[Tuple[int, _T]], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T], start: int = 0) -> None: ...
|
||||
def __iter__(self) -> Iterator[Tuple[int, _T]]: ...
|
||||
def __next__(self) -> Tuple[int, _T]: ...
|
||||
# TODO __getattribute__
|
||||
|
||||
class range(Sequence[int]):
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user