summaryrefslogtreecommitdiff
path: root/tests/functional/s/singleton_comparison.py
blob: d7ebdaf24153451f8a737549e08d0c3094d1e79e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# pylint: disable=missing-docstring, invalid-name, misplaced-comparison-constant,literal-comparison, comparison-with-itself
x = 42
a = x is None
b = x == None  # [singleton-comparison]
c = x == True  # [singleton-comparison]
d = x == False  # [singleton-comparison]
e = True == True  # [singleton-comparison]
f = x is 1
g = 123 is "123"
h = None is x
i = None == x  # [singleton-comparison]

j = x != True  # [singleton-comparison]
j1 = x != False  # [singleton-comparison]
j2 = x != None  # [singleton-comparison]
assert x == True  # [singleton-comparison]
assert x != False  # [singleton-comparison]
if x == True:  # [singleton-comparison]
    pass
z = bool(x == True)  # [singleton-comparison]