Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 808 Bytes

19062.new_feature.rst

File metadata and controls

21 lines (14 loc) · 808 Bytes

Assign the platform-specific c_intp precision via a mypy plugin

The mypy plugin, introduced in numpy/numpy#17843, has again been expanded: the plugin now is now responsible for setting the platform-specific precision of numpy.ctypeslib.c_intp, the latter being used as data type for various numpy.ndarray.ctypes attributes.

Without the plugin, aforementioned type will default to ctypes.c_int64.

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

[mypy]
plugins = numpy.typing.mypy_plugin