Skip to content

Commit

Permalink
Mark (c)math constants as final (#13410)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamdanal authored Jan 19, 2025
1 parent c2e4ef3 commit 70cf067
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions stdlib/cmath.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from typing import SupportsComplex, SupportsFloat, SupportsIndex
from typing import Final, SupportsComplex, SupportsFloat, SupportsIndex
from typing_extensions import TypeAlias

e: float
pi: float
inf: float
infj: complex
nan: float
nanj: complex
tau: float
e: Final[float]
pi: Final[float]
inf: Final[float]
infj: Final[complex]
nan: Final[float]
nanj: Final[complex]
tau: Final[float]

_C: TypeAlias = SupportsFloat | SupportsComplex | SupportsIndex | complex

Expand Down
12 changes: 6 additions & 6 deletions stdlib/math.pyi
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import sys
from collections.abc import Iterable
from typing import Protocol, SupportsFloat, SupportsIndex, TypeVar, overload
from typing import Final, Protocol, SupportsFloat, SupportsIndex, TypeVar, overload
from typing_extensions import TypeAlias

_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)

_SupportsFloatOrIndex: TypeAlias = SupportsFloat | SupportsIndex

e: float
pi: float
inf: float
nan: float
tau: float
e: Final[float]
pi: Final[float]
inf: Final[float]
nan: Final[float]
tau: Final[float]

def acos(x: _SupportsFloatOrIndex, /) -> float: ...
def acosh(x: _SupportsFloatOrIndex, /) -> float: ...
Expand Down

0 comments on commit 70cf067

Please sign in to comment.