mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-01 04:18:05 +00:00
## Summary
If an annotation won't be evaluated at runtime, we don't need to flag
`from __future__ import annotations` as required. This applies both to
quoted annotations and annotations outside of runtime-evaluated
positions, like:
```python
def main() -> None:
a_list: list[str] | None = []
a_list.append("hello")
```
Closes https://github.com/astral-sh/ruff/issues/11397.
|
||
|---|---|---|
| .. | ||
| edge_case.py | ||
| from_typing_import.py | ||
| from_typing_import_many.py | ||
| import_typing.py | ||
| import_typing_as.py | ||
| no_future_import_uses_lowercase.py | ||
| no_future_import_uses_union.py | ||
| no_future_import_uses_union_inner.py | ||
| ok_no_types.py | ||
| ok_non_simplifiable_types.py | ||
| ok_quoted_type.py | ||
| ok_uses_future.py | ||
| ok_variable_name.py | ||