summaryrefslogtreecommitdiff
path: root/testsuite/E72.py
blob: a60d892f17c93fa68ab8b0dbfd6d37f2fd445fc8 (plain)
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
80
81
82
#: E721
if type(res) == type(42):
    pass
#: E721
if type(res) != type(""):
    pass
#: E721
import types

if res == types.IntType:
    pass
#: E721
import types

if type(res) is not types.ListType:
    pass
#: E721
assert type(res) == type(False) or type(res) == type(None)
#: E721
assert type(res) == type([])
#: E721
assert type(res) == type(())
#: E721
assert type(res) == type((0,))
#: E721
assert type(res) == type((0))
#: E721
assert type(res) != type((1, ))
#: E721
assert type(res) is type((1, ))
#: E721
assert type(res) is not type((1, ))
#: E211 E721
assert type(res) == type ([2, ])
#: E201 E201 E202 E721
assert type(res) == type( ( ) )
#: E201 E202 E721
assert type(res) == type( (0, ) )
#:

#: Okay
import types

if isinstance(res, int):
    pass
if isinstance(res, str):
    pass
if isinstance(res, types.MethodType):
    pass
if type(a) != type(b) or type(a) == type(ccc):
    pass
#: Okay
def func_histype(a, b, c):
    pass
#: E722
try:
    pass
except:
    pass
#: E722
try:
    pass
except Exception:
    pass
except:
    pass
#: E722 E203 E271
try:
    pass
except  :
    pass
#: Okay
fake_code = """"
try:
    do_something()
except:
    pass
"""
try:
    pass
except Exception:
    pass