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:
z33ky
2017-01-04 14:52:51 +01:00
committed by Jukka Lehtosalo
parent 5f98dbb4bf
commit 93bb4604cb
2 changed files with 6 additions and 3 deletions

View File

@@ -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

View File

@@ -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