mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Update SupportsIndex support for math and cmath (#6216)
* SupportsIndex for cmath * Don't support __index__ on <3.7
This commit is contained in:
@@ -3,7 +3,10 @@ from _typeshed import SupportsTrunc
|
||||
from typing import Iterable, SupportsFloat, Union, overload
|
||||
from typing_extensions import SupportsIndex
|
||||
|
||||
_SupportsFloatOrIndex = Union[SupportsFloat, SupportsIndex]
|
||||
if sys.version_info >= (3, 8):
|
||||
_SupportsFloatOrIndex = Union[SupportsFloat, SupportsIndex]
|
||||
else:
|
||||
_SupportsFloatOrIndex = SupportsFloat
|
||||
|
||||
e: float
|
||||
pi: float
|
||||
@@ -36,7 +39,13 @@ def erfc(__x: _SupportsFloatOrIndex) -> float: ...
|
||||
def exp(__x: _SupportsFloatOrIndex) -> float: ...
|
||||
def expm1(__x: _SupportsFloatOrIndex) -> float: ...
|
||||
def fabs(__x: _SupportsFloatOrIndex) -> float: ...
|
||||
def factorial(__x: SupportsIndex) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def factorial(__x: SupportsIndex) -> int: ...
|
||||
|
||||
else:
|
||||
def factorial(__x: int) -> int: ...
|
||||
|
||||
def floor(__x: _SupportsFloatOrIndex) -> int: ...
|
||||
def fmod(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ...
|
||||
def frexp(__x: _SupportsFloatOrIndex) -> tuple[float, int]: ...
|
||||
|
||||
Reference in New Issue
Block a user