class documentation

class _NumpyPlugin(Plugin): (source)

View In Hierarchy

A mypy plugin for handling versus numpy-specific typing tasks.

Method get_additional_deps Handle all import-based overrides.
Method get_type_analyze_hook Set the precision of platform-specific numpy.number subclasses.
def get_additional_deps(self, file: MypyFile) -> list[tuple[int, str, int]]: (source)

Handle all import-based overrides.

  • Import platform-specific extended-precision numpy.number subclasses (e.g. numpy.float96, numpy.float128 and numpy.complex256).
  • Import the appropriate ctypes equivalent to numpy.intp.
def get_type_analyze_hook(self, fullname: str) -> None|_HookFunc: (source)

Set the precision of platform-specific numpy.number subclasses.

For example: numpy.int_, numpy.longlong and numpy.longdouble.