From 5223b26ec8121d5b28556e704714059ecd3d3125 Mon Sep 17 00:00:00 2001 From: Semyon Proshev Date: Wed, 18 Apr 2018 00:25:04 +0300 Subject: [PATCH] Add `__round__` to `int` and `float` in Python 3 (#2061) --- stdlib/3/builtins.pyi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index f919fbc2e..a8650269f 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -143,6 +143,7 @@ class int: def __neg__(self) -> int: ... def __pos__(self) -> int: ... def __invert__(self) -> int: ... + def __round__(self, ndigits: int = ...) -> int: ... def __eq__(self, x: object) -> bool: ... def __ne__(self, x: object) -> bool: ... @@ -182,6 +183,10 @@ class float: def __rmod__(self, x: float) -> float: ... def __rdivmod__(self, x: float) -> Tuple[float, float]: ... def __rpow__(self, x: float) -> float: ... + @overload + def __round__(self) -> int: ... + @overload + def __round__(self, ndigits: int) -> float: ... def __eq__(self, x: object) -> bool: ... def __ne__(self, x: object) -> bool: ...