Skip to content

Commit cc99763

Browse files
committed
Update tuple with Never tests and comment
1 parent 94cdb66 commit cc99763

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

crates/red_knot_python_semantic/resources/mdtest/type_properties/is_disjoint_from.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ static_assert(is_disjoint_from(tuple[Literal[1], Literal[2]], tuple[Literal[1],
8080
static_assert(not is_disjoint_from(tuple[Literal[1], Literal[2]], tuple[Literal[1], int]))
8181
```
8282

83-
If a tuple type contains a `Never` element, then it cannot be instantiated. Like `Never`, the type
84-
contains no objects, and is therefore disjoint from any other type.
83+
If a tuple type contains a `Never` element, then it is eagerly simplified to `Never` which means
84+
that a tuple type containing `Never` is disjoint from any other tuple type.
8585

8686
```py
87-
static_assert(is_disjoint_from(tuple[Never], tuple[Never]))
88-
static_assert(is_disjoint_from(tuple[int, Never], tuple[int, Never]))
89-
static_assert(is_disjoint_from(tuple[int, Never], tuple[Never, int]))
90-
static_assert(is_disjoint_from(tuple[int, Never], tuple[int, int]))
87+
def _(x: tuple[Never], y: tuple[int, Never], z: tuple[Never, int]):
88+
reveal_type(x) # revealed: Never
89+
reveal_type(y) # revealed: Never
90+
reveal_type(z) # revealed: Never
9191
```
9292

9393
## Unions

0 commit comments

Comments
 (0)