Skip to content

Commit 27ed964

Browse files
authored
Support variable annotation when variable start by a keyword
Support case when the variable name start by a keyword, eg: ``` class Test: formula: str = None ```
1 parent f1908ba commit 27ed964

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pycodestyle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
STARTSWITH_DEF_REGEX = re.compile(r'^(async\s+def|def)')
125125
STARTSWITH_TOP_LEVEL_REGEX = re.compile(r'^(async\s+def\s+|def\s+|class\s+|@)')
126126
STARTSWITH_INDENT_STATEMENT_REGEX = re.compile(
127-
r'^\s*({0})'.format('|'.join(s.replace(' ', '\s+') for s in (
127+
r'^\s*({0})\s'.format('|'.join(s.replace(' ', '\s+') for s in (
128128
'def', 'async def',
129129
'for', 'async for',
130130
'if', 'elif', 'else',

0 commit comments

Comments
 (0)