diff --git a/doc/whatsnew/fragments/10583.breaking b/doc/whatsnew/fragments/10583.breaking new file mode 100644 index 0000000000..3c17d99780 --- /dev/null +++ b/doc/whatsnew/fragments/10583.breaking @@ -0,0 +1,3 @@ +Removed support for ``nmp.NaN`` alias for ``numpy.NaN`` being recognized in ':ref:`nan-comparison`'. Use ``np`` or ``numpy`` instead. + +Refs #10583 diff --git a/pylint/checkers/base/comparison_checker.py b/pylint/checkers/base/comparison_checker.py index 2bde5475b4..2c1ad7c0a4 100644 --- a/pylint/checkers/base/comparison_checker.py +++ b/pylint/checkers/base/comparison_checker.py @@ -157,7 +157,7 @@ def _is_float_nan(node: nodes.NodeNG) -> bool: def _is_numpy_nan(node: nodes.NodeNG) -> bool: match node: case nodes.Attribute(attrname="NaN", expr=nodes.Name(name=name)): - return name in {"numpy", "nmp", "np"} + return name in {"numpy", "np"} return False def _is_nan(node: nodes.NodeNG) -> bool: