Skip to content

Commit a7701bf

Browse files
Update flake8_pyi/visitor.py
Co-authored-by: Alex Waygood <[email protected]>
1 parent feb231d commit a7701bf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

flake8_pyi/visitor.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,12 @@ def _is_bad_TypedDict(node: ast.Call) -> bool:
437437
return False
438438

439439
for key in typed_dict_annotations.keys:
440-
if not isinstance(key, ast.Constant) or type(key.value) is not str:
441-
return False
442-
if not key.value.isidentifier() or iskeyword(key.value):
440+
if not (
441+
isinstance(key, ast.Constant)
442+
and type(key.value) is str
443+
and key.value.isidentifier()
444+
and not iskeyword(key.value)
445+
):
443446
return False
444447
return True
445448

0 commit comments

Comments
 (0)