Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 899 Bytes

17843.new_feature.rst

File metadata and controls

22 lines (15 loc) · 899 Bytes

Added a mypy plugin for handling platform-specific numpy.number precisions

A mypy plugin is now available for automatically assigning the (platform-dependent) precisions of certain ~numpy.number subclasses, including the likes of ~numpy.int_, ~numpy.intp and ~numpy.longlong. See the documentation on :ref:`scalar types <arrays.scalars.built-in>` for a comprehensive overview of the affected classes.

Note that while usage of the plugin is completely optional, without it the precision of above-mentioned classes will be inferred as ~typing.Any.

To enable the plugin, one must add it to their mypy configuration file:

[mypy]
plugins = numpy.typing.mypy_plugin