Correct return value of round in Python 2. (#245)

In Python 2.7, round returns a float, even when ndigits is omitted. In Python 3, round returns an int if ndigits is omitted.
This commit is contained in:
erinhaswell
2016-06-02 19:00:20 -07:00
committed by Guido van Rossum
parent 97c62932d5
commit 2c52d9a612

View File

@@ -750,7 +750,7 @@ def reversed(object: Reversible[_T]) -> Iterator[_T]: ...
def reversed(object: Sequence[_T]) -> Iterator[_T]: ...
def repr(o: object) -> str: ...
@overload
def round(number: float) -> int: ...
def round(number: float) -> float: ...
@overload
def round(number: float, ndigits: int) -> float: ... # Always return a float if given ndigits.
@overload