aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/parso/py3/tests/normalizer_issue_files/E72.py
blob: 2e9ef9151d79632b5cbfdc5304e194584f98847d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#: E721:3
if type(res) == type(42):
    pass
#: E721:3
if type(res) != type(""):
    pass

import types

if res == types.IntType:
    pass

import types

#: E721:3
if type(res) is not types.ListType:
    pass
#: E721:7 E721:35
assert type(res) == type(False) or type(res) == type(None)
#: E721:7
assert type(res) == type([])
#: E721:7
assert type(res) == type(())
#: E721:7
assert type(res) == type((0,))
#: E721:7
assert type(res) == type((0))
#: E721:7
assert type(res) != type((1,))
#: E721:7
assert type(res) is type((1,))
#: E721:7
assert type(res) is not type((1,))

# Okay
#: E402
import types

if isinstance(res, int):
    pass
if isinstance(res, str):
    pass
if isinstance(res, types.MethodType):
    pass

#: E721:3 E721:25
if type(a) != type(b) or type(a) == type(ccc):
    pass
#: E721
type(a) != type(b)
#: E721
1 != type(b)
#: E721
type(b) != 1
1 != 1

try:
    pass
#: E722
except:
    pass
try:
    pass
except Exception:
    pass
#: E722
except:
    pass
# Okay
fake_code = """"
try:
    do_something()
except:
    pass
"""
try:
    pass
except Exception:
    pass