mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00

## Summary - `Never` is callable - `Never` is iterable - Arbitrary attributes can be accessed on `Never` Split out from #16416 that is going to be required. ## Test Plan Tests for all properties above.
339 B
339 B
Never is callable
The type Never
is callable with an arbitrary set of arguments. The result is always Never
.
from typing_extensions import Never
def f(never: Never):
reveal_type(never()) # revealed: Never
reveal_type(never(1)) # revealed: Never
reveal_type(never(1, "a", never, x=None)) # revealed: Never