Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pycodestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,10 @@ def module_imports_on_top_of_file(
return
if noqa:
return
if logical_line.startswith(('import ', 'from ')):
if logical_line.startswith((
'import ', 'from ',
'lazy import ', 'lazy from ',
)):
if checker_state.get('seen_non_imports', False):
yield 0, "E402 module level import not at top of file"
elif not checker_state.get('seen_non_imports', False):
Expand Down
9 changes: 9 additions & 0 deletions testing/data/python315.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os
lazy from typing import LiteralString
import sys
lazy import asyncio

[*y for y in x]
{*y for y in x}
(*y for y in x)
{**y for y in x}
Loading