aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/parso/py3/tests/normalizer_issue_files/E30.py
blob: 31e241cd44f826af5675560b7bfd2a1a69c4652b (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#: E301+4
class X:

    def a():
        pass
    def b():
        pass


#: E301+5
class X:

    def a():
        pass
    # comment
    def b():
        pass


# -*- coding: utf-8 -*-
def a():
    pass


#: E302+1:0
"""Main module."""
def _main():
    pass


#: E302+1:0
foo = 1
def get_sys_path():
    return sys.path


#: E302+3:0
def a():
    pass

def b():
    pass


#: E302+5:0
def a():
    pass

# comment

def b():
    pass


#: E303+3:0
print



#: E303+3:0 E303+4:0
print




print
#: E303+3:0
print



# comment

print


#: E303+3 E303+6
def a():
    print


    # comment


    # another comment

    print


#: E302+2
a = 3
#: E304+1
@decorator

def function():
    pass


#: E303+3
# something



"""This class docstring comes on line 5.
It gives error E303: too many blank lines (3)
"""


#: E302+6
def a():
    print

    # comment

    # another comment
a()


#: E302+7
def a():
    print

    # comment

    # another comment

try:
    a()
except Exception:
    pass


#: E302+4
def a():
    print

# Two spaces before comments, too.
if a():
    a()


#: E301+2
def a():
    x = 1
    def b():
        pass


#: E301+2 E301+4
def a():
    x = 2
    def b():
        x = 1
        def c():
            pass


#: E301+2 E301+4 E301+5
def a():
    x = 1
    class C:
        pass
    x = 2
    def b():
        pass


#: E302+7
# Example from https://github.com/PyCQA/pycodestyle/issues/400
foo = 2


def main():
    blah, blah

if __name__ == '__main__':
    main()