Skip to content

Commit 42c0131

Browse files
Remove support for nmp.NaN as import alias for numpy.NaN in nan-comparison (#10583)
Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent a60b85d commit 42c0131

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Removed support for ``nmp.NaN`` alias for ``numpy.NaN`` being recognized in ':ref:`nan-comparison`'. Use ``np`` or ``numpy`` instead.
2+
3+
Refs #10583

pylint/checkers/base/comparison_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _is_float_nan(node: nodes.NodeNG) -> bool:
157157
def _is_numpy_nan(node: nodes.NodeNG) -> bool:
158158
match node:
159159
case nodes.Attribute(attrname="NaN", expr=nodes.Name(name=name)):
160-
return name in {"numpy", "nmp", "np"}
160+
return name in {"numpy", "np"}
161161
return False
162162

163163
def _is_nan(node: nodes.NodeNG) -> bool:

0 commit comments

Comments
 (0)