Skip to content

ENH: Mark all constants as Final #17507

Closed

Description

@BvB93

A number of constants are present in the main numpy namespace, however their annotations
are currently not marked as such.

TODO

  • Mark constants (see below) with typing.Final. For example, Inf: float should become Inf: Final[float].
    Note that Final was introduced to the builtin typing module in python 3.8; for older versions it'll have to be imported from typing_extensions.

numpy/numpy/__init__.pyi

Lines 1600 to 1641 in 29c58e6

Inf: float
Infinity: float
NAN: float
NINF: float
NZERO: float
NaN: float
PINF: float
PZERO: float
e: float
euler_gamma: float
inf: float
infty: float
nan: float
pi: float
ALLOW_THREADS: int
BUFSIZE: int
CLIP: int
ERR_CALL: int
ERR_DEFAULT: int
ERR_IGNORE: int
ERR_LOG: int
ERR_PRINT: int
ERR_RAISE: int
ERR_WARN: int
FLOATING_POINT_SUPPORT: int
FPE_DIVIDEBYZERO: int
FPE_INVALID: int
FPE_OVERFLOW: int
FPE_UNDERFLOW: int
MAXDIMS: int
MAY_SHARE_BOUNDS: int
MAY_SHARE_EXACT: int
RAISE: int
SHIFT_DIVIDEBYZERO: int
SHIFT_INVALID: int
SHIFT_OVERFLOW: int
SHIFT_UNDERFLOW: int
UFUNC_BUFSIZE_DEFAULT: int
WRAP: int
little_endian: int
tracemalloc_domain: int

Activity

  1. roysti10 commented on Oct 8, 2020

    @roysti10
    Contributor

    Could I take this up?

  2. BvB93 commented on Oct 8, 2020

    @BvB93
    MemberAuthor

    Sure, feel free to go ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions