diff options
author | Bas van Beek <b.f.van.beek@vu.nl> | 2021-05-21 21:08:17 +0200 |
---|---|---|
committer | Bas van Beek <b.f.van.beek@vu.nl> | 2021-05-21 21:15:16 +0200 |
commit | 0f10cd9423b589d8b3e5dd814dbe5dfb55f7157e (patch) | |
tree | 6df7bc2ac6a966ea5464dd9d4fed2a059f83be25 | |
parent | 5eca599bccb93edccf9a61de76ddc6125b5a76cf (diff) | |
download | numpy-0f10cd9423b589d8b3e5dd814dbe5dfb55f7157e.tar.gz |
REL: Add a release note for the latest mypy plugin update
-rw-r--r-- | doc/release/upcoming_changes/19062.new_feature.rst | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/release/upcoming_changes/19062.new_feature.rst b/doc/release/upcoming_changes/19062.new_feature.rst new file mode 100644 index 000000000..171715568 --- /dev/null +++ b/doc/release/upcoming_changes/19062.new_feature.rst @@ -0,0 +1,21 @@ +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`_: + +.. code-block:: ini + + [mypy] + plugins = numpy.typing.mypy_plugin + + +.. _mypy: http://mypy-lang.org/ +.. _configuration file: https://mypy.readthedocs.io/en/stable/config_file.html +.. _`numpy/numpy#17843`: https://github.com/numpy/numpy/pull/17843 |