diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 06e08793d..aa4953e88 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -7,7 +7,7 @@ from typing import ( TypeVar, Iterator, Iterable, NoReturn, overload, Sequence, Mapping, Tuple, List, Any, Dict, Callable, Generic, Set, AbstractSet, FrozenSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, - SupportsRound, IO, BinaryIO, Union, AnyStr, MutableSequence, MutableMapping, + SupportsComplex, SupportsRound, IO, BinaryIO, Union, AnyStr, MutableSequence, MutableMapping, MutableSet, ItemsView, KeysView, ValuesView, Optional, Container, Type ) from abc import abstractmethod, ABCMeta @@ -187,6 +187,8 @@ class complex: def __init__(self, re: float = ..., im: float = ...) -> None: ... @overload def __init__(self, s: str) -> None: ... + @overload + def __init__(self, s: SupportsComplex) -> None: ... @property def real(self) -> float: ... @@ -213,6 +215,7 @@ class complex: def __neg__(self) -> complex: ... def __pos__(self) -> complex: ... + def __complex__(self) -> complex: ... def __str__(self) -> str: ... def __abs__(self) -> float: ... def __hash__(self) -> int: ... diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 8db945191..f919fbc2e 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -4,8 +4,8 @@ from typing import ( TypeVar, Iterator, Iterable, overload, Container, Sequence, MutableSequence, Mapping, MutableMapping, NoReturn, Tuple, List, Any, Dict, Callable, Generic, Set, AbstractSet, FrozenSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat, - SupportsBytes, SupportsAbs, SupportsRound, IO, Union, ItemsView, KeysView, ValuesView, - ByteString, Optional, AnyStr, Type, + SupportsComplex, SupportsBytes, SupportsAbs, SupportsRound, IO, Union, ItemsView, KeysView, + ValuesView, ByteString, Optional, AnyStr, Type, ) from abc import abstractmethod, ABCMeta from types import TracebackType, CodeType @@ -204,6 +204,8 @@ class complex: def __init__(self, re: float = ..., im: float = ...) -> None: ... @overload def __init__(self, s: str) -> None: ... + @overload + def __init__(self, s: SupportsComplex) -> None: ... @property def real(self) -> float: ... @@ -229,6 +231,7 @@ class complex: def __pos__(self) -> complex: ... def __str__(self) -> str: ... + def __complex__(self) -> complex: ... def __abs__(self) -> float: ... def __hash__(self) -> int: ... def __bool__(self) -> bool: ...