-
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.
Respect dictionary unpacking in
NamedTuple
assignments (#8810)
Closes #8803.
- Loading branch information
1 parent
d9151b1
commit 5373759
Showing
4 changed files
with
52 additions
and
19 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
crates/ruff_linter/resources/test/fixtures/pyflakes/F821_23.py
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,7 @@ | ||
"""Test for type annotation parsing in `NamedTuple`.""" | ||
|
||
import typing | ||
|
||
User = typing.NamedTuple('User', **{'name': str, 'password': bytes}) | ||
User = typing.NamedTuple('User', name=str, password=bytes) | ||
User = typing.NamedTuple('User', [('name', str), ('password', bytes)]) |
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
4 changes: 4 additions & 0 deletions
4
...er/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_23.py.snap
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,4 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pyflakes/mod.rs | ||
--- | ||
|