From 2c52d9a6123fe0b1d906fc184ca9bb66e2d12f41 Mon Sep 17 00:00:00 2001 From: erinhaswell Date: Thu, 2 Jun 2016 19:00:20 -0700 Subject: [PATCH] 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. --- stdlib/2.7/__builtin__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/2.7/__builtin__.pyi b/stdlib/2.7/__builtin__.pyi index 507cde958..c23c91379 100644 --- a/stdlib/2.7/__builtin__.pyi +++ b/stdlib/2.7/__builtin__.pyi @@ -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