mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-06 08:00:18 +07:00
to avoid ambiguous conditions IJ-MR-159379 GitOrigin-RevId: 4de5b135442b69b0667712066446cf035a23ecea
37 lines
1.7 KiB
Python
37 lines
1.7 KiB
Python
if <weak_warning descr="Expression can be simplified">a == True</weak_warning>: ...
|
|
if a is True: ...
|
|
if a is False: ...
|
|
if a is not False: ...
|
|
if a is not True: ...
|
|
if <weak_warning descr="Expression can be simplified">a == []</weak_warning>: ...
|
|
if <weak_warning descr="Expression can be simplified">a != []</weak_warning>: ...
|
|
if <weak_warning descr="Expression can be simplified">b == False</weak_warning>: ...
|
|
if <weak_warning descr="Expression can be simplified">c != True</weak_warning>: ...
|
|
if <weak_warning descr="Expression can be simplified">d != False</weak_warning>: ...
|
|
if <weak_warning descr="Expression can be simplified">a == False</weak_warning>: ...
|
|
|
|
# test in a non-boolean context
|
|
var = a is not True
|
|
|
|
# PY-6876
|
|
if a == 0: ...
|
|
|
|
# PY-42817
|
|
def f(b: bool, bn: bool | None, l: list, ln: list | None):
|
|
if <weak_warning descr="Expression can be simplified">False is b</weak_warning>: ...
|
|
if <weak_warning descr="Expression can be simplified">False is not b</weak_warning>: ...
|
|
if <weak_warning descr="Expression can be simplified">bn is True</weak_warning>: ...
|
|
if <weak_warning descr="Expression can be simplified">bn is not True</weak_warning>: ...
|
|
if <weak_warning descr="Expression can be simplified">bn == True</weak_warning>: ...
|
|
if <weak_warning descr="Expression can be simplified">bn != True</weak_warning>: ...
|
|
if bn is False: ...
|
|
if False is bn: ...
|
|
if bn is not False: ...
|
|
if bn == False: ...
|
|
if bn != False: ...
|
|
|
|
if <weak_warning descr="Expression can be simplified">l == []</weak_warning>: ...
|
|
if <weak_warning descr="Expression can be simplified">l != []</weak_warning>: ...
|
|
if ln == []: ...
|
|
if ln != []: ...
|