mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-19 12:16:43 +00:00
## Summary Allow values of type `None` in type expressions. The [typing spec](https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions) could be more explicit on whether this is actually allowed or not, but it seems relatively harmless and does help in some use cases like: ```py try: from module import MyClass except ImportError: MyClass = None # ty: ignore def f(m: MyClass): pass ``` ## Test Plan Updated tests, ecosystem check. |
||
|---|---|---|
| .. | ||
| resources | ||
| src | ||
| tests | ||
| build.rs | ||
| Cargo.toml | ||
| mdtest.py | ||
| mdtest.py.lock | ||