@@ -250,10 +250,12 @@ def blank_lines(logical_line, blank_lines, indent_level, line_number,
250
250
Use blank lines in functions, sparingly, to indicate logical sections.
251
251
252
252
Okay: def a():\n pass\n\n\ndef b():\n pass
253
+ Okay: def a():\n pass\n\n\nasync def b():\n pass
253
254
Okay: def a():\n pass\n\n\n# Foo\n# Bar\n\ndef b():\n pass
254
255
255
256
E301: class Foo:\n b = 0\n def bar():\n pass
256
257
E302: def a():\n pass\n\ndef b(n):\n pass
258
+ E302: def a():\n pass\n\nasync def b(n):\n pass
257
259
E303: def a():\n pass\n\n\n\ndef b(n):\n pass
258
260
E303: def a():\n\n\n\n pass
259
261
E304: @decorator\n\ndef a():\n pass
@@ -266,7 +268,7 @@ def blank_lines(logical_line, blank_lines, indent_level, line_number,
266
268
yield 0 , "E304 blank lines found after function decorator"
267
269
elif blank_lines > 2 or (indent_level and blank_lines == 2 ):
268
270
yield 0 , "E303 too many blank lines (%d)" % blank_lines
269
- elif logical_line .startswith (('def ' , 'class ' , '@' )):
271
+ elif logical_line .startswith (('def ' , 'async def' , ' class ' , '@' )):
270
272
if indent_level :
271
273
if not (blank_before or previous_indent_level < indent_level or
272
274
DOCSTRING_REGEX .match (previous_logical )):
0 commit comments