From 53496cdf82d6c9a3ddb40c12746d3257d9e09396 Mon Sep 17 00:00:00 2001 From: Bas van Beek Date: Thu, 4 Feb 2021 16:10:30 +0100 Subject: REL: Add a release note for the mypy plugin update --- doc/release/upcoming_changes/18322.new_feature.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/release/upcoming_changes/18322.new_feature.rst (limited to 'doc') diff --git a/doc/release/upcoming_changes/18322.new_feature.rst b/doc/release/upcoming_changes/18322.new_feature.rst new file mode 100644 index 000000000..5330b9a97 --- /dev/null +++ b/doc/release/upcoming_changes/18322.new_feature.rst @@ -0,0 +1,22 @@ +Let the mypy plugin manage extended-precision `numpy.number` subclasses +----------------------------------------------------------------------- + +The mypy_ plugin, introduced in `numpy/numpy#17843`_, has been expanded: +the plugin now removes annotations for platform-specific extended-precision +types that are not available to the platform in question. +For example, it will remove `~numpy.float128` when not available. + +Without the plugin *all* extended-precision types will, as far as mypy is concerned, +be available on all platforms. + +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 -- cgit v1.2.1