Skip to content

Commit e7a0faf

Browse files
Fix false-positive for unnecessary-ellipsis checker on comparisons (#6075)
Closes #6071. Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent 57a4d13 commit e7a0faf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/functional/u/unnecessary/unnecessary_ellipsis.py

+15
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,18 @@ def func_with_ellipsis_default_arg(a = ...) -> None:
114114

115115
# Ignore if the ellipsis is used with a lambda expression
116116
print("x", lambda: ...)
117+
118+
119+
def func1(val1, _):
120+
if val1 is not ...:
121+
pass
122+
123+
124+
def func2(val1, val2):
125+
"""Ignore if ellipsis is used on comparisons.
126+
See https://github.com/PyCQA/pylint/issues/6071."""
127+
if val1 is not ... and val2:
128+
pass
129+
130+
131+
assert "x" != ...

0 commit comments

Comments
 (0)