diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index ecd664602..8bdeff309 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -143,7 +143,7 @@ class int: def __neg__(self) -> int: ... def __pos__(self) -> int: ... def __invert__(self) -> int: ... - def __round__(self, ndigits: int = ...) -> int: ... + def __round__(self, ndigits: Optional[int] = ...) -> int: ... def __eq__(self, x: object) -> bool: ... def __ne__(self, x: object) -> bool: ... @@ -186,6 +186,8 @@ class float: @overload def __round__(self) -> int: ... @overload + def __round__(self, ndigits: None) -> int: ... + @overload def __round__(self, ndigits: int) -> float: ... def __eq__(self, x: object) -> bool: ... @@ -912,9 +914,13 @@ def repr(o: object) -> str: ... @overload def round(number: float) -> int: ... @overload -def round(number: float, ndigits: int) -> float: ... # Always return a float if given ndigits. +def round(number: float, ndigits: None) -> int: ... @overload -def round(number: SupportsRound[_T]) -> _T: ... +def round(number: float, ndigits: int) -> float: ... +@overload +def round(number: SupportsRound[_T]) -> int: ... +@overload +def round(number: SupportsRound[_T], ndigits: None) -> int: ... # type: ignore @overload def round(number: SupportsRound[_T], ndigits: int) -> _T: ... def setattr(object: Any, name: str, value: Any) -> None: ...