-
Notifications
You must be signed in to change notification settings - Fork 903
/
ruff_linter__rules__pyflakes__tests__F821_F821_26.py.snap
83 lines (75 loc) · 2.89 KB
/
ruff_linter__rules__pyflakes__tests__F821_F821_26.py.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
F821_26.py:9:33: F821 Undefined name `CStr`
|
8 | # Forward references:
9 | MaybeCStr: TypeAlias = Optional[CStr] # valid in a `.pyi` stub file, not in a `.py` runtime file
| ^^^^ F821
10 | MaybeCStr2: TypeAlias = Optional["CStr"] # always okay
11 | CStr: TypeAlias = Union[C, str] # valid in a `.pyi` stub file, not in a `.py` runtime file
|
F821_26.py:11:25: F821 Undefined name `C`
|
9 | MaybeCStr: TypeAlias = Optional[CStr] # valid in a `.pyi` stub file, not in a `.py` runtime file
10 | MaybeCStr2: TypeAlias = Optional["CStr"] # always okay
11 | CStr: TypeAlias = Union[C, str] # valid in a `.pyi` stub file, not in a `.py` runtime file
| ^ F821
12 | CStr2: TypeAlias = Union["C", str] # always okay
|
F821_26.py:16:12: F821 Undefined name `C`
|
14 | # References to a class from inside the class:
15 | class C:
16 | other: C = ... # valid in a `.pyi` stub file, not in a `.py` runtime file
| ^ F821
17 | other2: "C" = ... # always okay
18 | def from_str(self, s: str) -> C: ... # valid in a `.pyi` stub file, not in a `.py` runtime file
|
F821_26.py:18:35: F821 Undefined name `C`
|
16 | other: C = ... # valid in a `.pyi` stub file, not in a `.py` runtime file
17 | other2: "C" = ... # always okay
18 | def from_str(self, s: str) -> C: ... # valid in a `.pyi` stub file, not in a `.py` runtime file
| ^ F821
19 | def from_str2(self, s: str) -> "C": ... # always okay
|
F821_26.py:23:10: F821 Undefined name `B`
|
21 | # Circular references:
22 | class A:
23 | foo: B # valid in a `.pyi` stub file, not in a `.py` runtime file
| ^ F821
24 | foo2: "B" # always okay
25 | bar: dict[str, B] # valid in a `.pyi` stub file, not in a `.py` runtime file
|
F821_26.py:25:20: F821 Undefined name `B`
|
23 | foo: B # valid in a `.pyi` stub file, not in a `.py` runtime file
24 | foo2: "B" # always okay
25 | bar: dict[str, B] # valid in a `.pyi` stub file, not in a `.py` runtime file
| ^ F821
26 | bar2: dict[str, "A"] # always okay
|
F821_26.py:33:17: F821 Undefined name `Tree`
|
32 | class Leaf: ...
33 | class Tree(list[Tree | Leaf]): ... # valid in a `.pyi` stub file, not in a `.py` runtime file
| ^^^^ F821
34 | class Tree2(list["Tree | Leaf"]): ... # always okay
|
F821_26.py:39:11: F821 Undefined name `foo`
|
37 | class MyClass:
38 | foo: int
39 | bar = foo # valid in a `.pyi` stub file, not in a `.py` runtime file
| ^^^ F821
40 | bar = "foo" # always okay
|
F821_26.py:43:8: F821 Undefined name `baz`
|
42 | baz: MyClass
43 | eggs = baz # valid in a `.pyi` stub file, not in a `.py` runtime file
| ^^^ F821
44 | eggs = "baz" # always okay
|