diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 403bed0cbc91..da882b108605 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -69,6 +69,9 @@ if sys.version_info >= (3, 9): class _SupportsIndex(Protocol): def __index__(self) -> int: ... +class _SupportsTrunc(Protocol): + def __trunc__(self) -> int: ... + class _SupportsLessThan(Protocol): def __lt__(self, __other: Any) -> bool: ... @@ -182,7 +185,7 @@ class super(object): class int: @overload - def __new__(cls: Type[_T], x: Union[Text, bytes, SupportsInt, _SupportsIndex] = ...) -> _T: ... + def __new__(cls: Type[_T], x: Union[Text, bytes, SupportsInt, _SupportsIndex, _SupportsTrunc] = ...) -> _T: ... @overload def __new__(cls: Type[_T], x: Union[Text, bytes, bytearray], base: int) -> _T: ... if sys.version_info >= (3, 8): diff --git a/stdlib/2and3/builtins.pyi b/stdlib/2and3/builtins.pyi index 403bed0cbc91..da882b108605 100644 --- a/stdlib/2and3/builtins.pyi +++ b/stdlib/2and3/builtins.pyi @@ -69,6 +69,9 @@ if sys.version_info >= (3, 9): class _SupportsIndex(Protocol): def __index__(self) -> int: ... +class _SupportsTrunc(Protocol): + def __trunc__(self) -> int: ... + class _SupportsLessThan(Protocol): def __lt__(self, __other: Any) -> bool: ... @@ -182,7 +185,7 @@ class super(object): class int: @overload - def __new__(cls: Type[_T], x: Union[Text, bytes, SupportsInt, _SupportsIndex] = ...) -> _T: ... + def __new__(cls: Type[_T], x: Union[Text, bytes, SupportsInt, _SupportsIndex, _SupportsTrunc] = ...) -> _T: ... @overload def __new__(cls: Type[_T], x: Union[Text, bytes, bytearray], base: int) -> _T: ... if sys.version_info >= (3, 8):