ruff/crates/red_knot_python_semantic/resources/mdtest/call/never.md
David Peter 0a627ef216
[red-knot] Never is callable and iterable. Arbitrary attributes can be accessed. (#16533)
## 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.
2025-03-06 15:59:19 +00:00

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