diff options
-rwxr-xr-x | pycodestyle.py | 2 | ||||
-rw-r--r-- | testsuite/python38.py | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/pycodestyle.py b/pycodestyle.py index 68d31d4..1d98dce 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -169,7 +169,7 @@ STARTSWITH_INDENT_STATEMENT_REGEX = re.compile( 'while', ))) ) -DUNDER_REGEX = re.compile(r'^__([^\s]+)__ = ') +DUNDER_REGEX = re.compile(r"^__([^\s]+)__(?::\s*[a-zA-Z.0-9_\[\]\"]+)? = ") MATCH_CASE_REGEX = re.compile(r'^\s*\b(?:match|case)(\s*)(?=.*\:)') BLANK_EXCEPT_REGEX = re.compile(r"except\s*:") diff --git a/testsuite/python38.py b/testsuite/python38.py index f927673..1374192 100644 --- a/testsuite/python38.py +++ b/testsuite/python38.py @@ -28,3 +28,17 @@ if x:= 1: #: E225:1:18 if False or (x :=1): pass +#: Okay +import typing as t + +__all__: t.List[str] = [] + +import logging + +logging.getLogger(__name__) +#: E402 +import typing as t + +all_the_things: t.List[str] = [] + +import logging |