mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
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:
committed by
Guido van Rossum
parent
97c62932d5
commit
2c52d9a612
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user