-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[
pyflakes
] Treat arguments passed to the default=
parameter of `T…
…ypeVar` as type expressions (`F821`) (#15679)
- Loading branch information
1 parent
05abd64
commit 555b3a6
Showing
4 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
crates/ruff_linter/resources/test/fixtures/pyflakes/F821_32.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,6 @@ | ||
from typing import TypeVar | ||
|
||
# Forward references are okay for both `bound` and `default` in a stub file | ||
_P = TypeVar("_P", bound=X, default=X) | ||
|
||
class X: ... |
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
...r/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_32.pyi.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 | ||
--- | ||
|