Skip to content

Commit 4c8152c

Browse files
committed
Add more doctests for E741
1 parent 26893da commit 4c8152c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

pycodestyle.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,19 @@ def ambiguous_identifier(logical_line, tokens):
11571157
one and zero. When tempted to use 'l', use 'L' instead.
11581158
11591159
Okay: L = 0
1160+
Okay: o = 123
1161+
Okay: i = 42
11601162
E741: l = 0
1163+
E741: O = 123
1164+
E741: I = 42
1165+
1166+
Variables can be bound in other contexts, so identifiers appearing after
1167+
the 'as' keyword are also reported:
1168+
1169+
Okay: except AttributeError as o:
1170+
Okay: with lock as L:
1171+
E741: except AttributeError as O:
1172+
E741: with lock as l:
11611173
"""
11621174
idents_to_avoid = ('l', 'O', 'I')
11631175
prev_type, prev_text, prev_start, prev_end, __ = tokens[0]

0 commit comments

Comments
 (0)