From 17df032a0ff5d0a1ae97b05b65a65ba28d778d97 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Thu, 23 Jan 2020 22:10:20 -0800 Subject: [PATCH] builtins.pow: fix for negative exp --- stdlib/2and3/builtins.pyi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stdlib/2and3/builtins.pyi b/stdlib/2and3/builtins.pyi index 3dd79deb214b..50a196ed7130 100644 --- a/stdlib/2and3/builtins.pyi +++ b/stdlib/2and3/builtins.pyi @@ -1372,12 +1372,16 @@ else: if sys.version_info >= (3, 8): @overload - def pow(base: int, exp: int, mod: Optional[int] = ...) -> int: ... + def pow(base: int, exp: int, mod: None = ...) -> Any: ... # returns int or float depending on whether exp is non-negative + @overload + def pow(base: int, exp: int, mod: int) -> int: ... @overload def pow(base: float, exp: float, mod: None = ...) -> float: ... else: @overload - def pow(__base: int, __exp: int, __mod: Optional[int] = ...) -> int: ... + def pow(__base: int, __exp: int, __mod: None = ...) -> Any: ... # returns int or float depending on whether exp is non-negative + @overload + def pow(__base: int, __exp: int, __mod: int) -> int: ... @overload def pow(__base: float, __exp: float, __mod: None = ...) -> float: ... def quit(code: object = ...) -> NoReturn: ...