---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
F821 Undefined name `CStr`
  --> F821_26.py:9:33
   |
 8 | # Forward references:
 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 Undefined name `C`
  --> F821_26.py:11:25
   |
 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
   |                         ^
12 | CStr2: TypeAlias = Union["C", str]  # always okay
   |

F821 Undefined name `Tree`
  --> F821_26.py:33:17
   |
32 | class Leaf: ...
33 | class Tree(list[Tree | Leaf]): ...  # valid in a `.pyi` stub file, not in a `.py` runtime file
   |                 ^^^^
34 | class Tree2(list["Tree | Leaf"]): ...  # always okay
   |

F821 Undefined name `foo`
  --> F821_26.py:39:11
   |
37 | class MyClass:
38 |     foo: int
39 |     bar = foo  # valid in a `.pyi` stub file, not in a `.py` runtime file
   |           ^^^
40 |     bar = "foo"  # always okay
   |

F821 Undefined name `baz`
  --> F821_26.py:43:8
   |
42 | baz: MyClass
43 | eggs = baz  # valid in a `.pyi` stub file, not in a `.py` runtime file
   |        ^^^
44 | eggs = "baz"  # always okay
   |
