mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-28 10:50:26 +00:00
## Summary Use the declared type of variables as type context for the RHS of assignment expressions, e.g., ```py x: list[int | str] x = [1] reveal_type(x) # revealed: list[int | str] ``` |
||
|---|---|---|
| .. | ||
| conditionals | ||
| assert.md | ||
| assignment.md | ||
| bool-call.md | ||
| boolean.md | ||
| complex_target.md | ||
| hasattr.md | ||
| isinstance.md | ||
| issubclass.md | ||
| match.md | ||
| post_if_statement.md | ||
| truthiness.md | ||
| type.md | ||
| type_guards.md | ||
| while.md | ||