-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Alex Waygood <[email protected]>
- Loading branch information
1 parent
a5ef124
commit 4e1b289
Showing
9 changed files
with
326 additions
and
26 deletions.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
crates/ruff_linter/resources/test/fixtures/pycodestyle/E741.pyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
from contextlib import contextmanager | ||
|
||
l = 0 | ||
I = 0 | ||
O = 0 | ||
l: int = 0 | ||
|
||
a, l = 0, 1 | ||
[a, l] = 0, 1 | ||
a, *l = 0, 1, 2 | ||
a = l = 0 | ||
|
||
o = 0 | ||
i = 0 | ||
|
||
for l in range(3): | ||
pass | ||
|
||
|
||
for a, l in zip(range(3), range(3)): | ||
pass | ||
|
||
|
||
def f1(): | ||
global l | ||
l = 0 | ||
|
||
|
||
def f2(): | ||
l = 0 | ||
|
||
def f3(): | ||
nonlocal l | ||
l = 1 | ||
|
||
f3() | ||
return l | ||
|
||
|
||
def f4(l, /, I): | ||
return l, I, O | ||
|
||
|
||
def f5(l=0, *, I=1): | ||
return l, I | ||
|
||
|
||
def f6(*l, **I): | ||
return l, I | ||
|
||
|
||
@contextmanager | ||
def ctx1(): | ||
yield 0 | ||
|
||
|
||
with ctx1() as l: | ||
pass | ||
|
||
|
||
@contextmanager | ||
def ctx2(): | ||
yield 0, 1 | ||
|
||
|
||
with ctx2() as (a, l): | ||
pass | ||
|
||
try: | ||
pass | ||
except ValueError as l: | ||
pass | ||
|
||
if (l := 5) > 0: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.