From a80066952ef81b012a5de2e9dc27c6ef5b91bb76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E8=91=89?= Date: Thu, 16 May 2019 17:00:44 +0800 Subject: [PATCH] Add missing annotation in cmath module (#2989) --- stdlib/2and3/cmath.pyi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/stdlib/2and3/cmath.pyi b/stdlib/2and3/cmath.pyi index bcfc6f605..4b15f0b78 100644 --- a/stdlib/2and3/cmath.pyi +++ b/stdlib/2and3/cmath.pyi @@ -1,12 +1,18 @@ """Stub file for the 'cmath' module.""" import sys -from typing import Union, Tuple +from typing import SupportsComplex, SupportsFloat, Tuple, Union e: float pi: float +if sys.version_info >= (3, 6): + inf: float + infj: complex + nan: float + nanj: complex + tau: float -_C = Union[float, complex] +_C = Union[SupportsFloat, SupportsComplex] def acos(x: _C) -> complex: ... def acosh(x: _C) -> complex: ... @@ -17,6 +23,8 @@ def atanh(x: _C) -> complex: ... def cos(x: _C) -> complex: ... def cosh(x: _C) -> complex: ... def exp(x: _C) -> complex: ... +if sys.version_info >= (3, 5): + def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... def isinf(z: _C) -> bool: ... def isnan(z: _C) -> bool: ... def log(x: _C, base: _C = ...) -> complex: ...