Skip to content

Commit 398f2e8

Browse files
authored
[red-knot] Minor fixes in intersection-types tests (#15410)
## Summary Minor fixes in intersection-types tests
1 parent 232fbc1 commit 398f2e8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

crates/red_knot_python_semantic/resources/mdtest/intersection_types.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ static_assert(not is_subtype_of(B2, B1))
105105
This section covers structural properties of intersection types and documents some decisions on how
106106
to represent mixtures of intersections and unions.
107107

108-
### Single-element unions
108+
### Single-element intersections
109109

110-
If we have a union of a single element, we can simplify to that element. Similarly, we show an
111-
intersection with a single negative contribution as just the negation of that element.
110+
If we have an intersection with a single element, we can simplify to that element. Similarly, we
111+
show an intersection with a single negative contribution as just the negation of that element.
112112

113113
```py
114114
from knot_extensions import Intersection, Not
@@ -422,8 +422,8 @@ def example_type_bool_type_str(
422422

423423
#### Positive and negative contributions
424424

425-
If we intersect a type `X` with the negation of a disjoint type `Y`, we can remove the negative
426-
contribution `~Y`, as it necessarily overlaps with the positive contribution `X`:
425+
If we intersect a type `X` with the negation `~Y` of a disjoint type `Y`, we can remove the negative
426+
contribution `~Y`, as `~Y` must fully contain the positive contribution `X` as a subtype:
427427

428428
```py
429429
from knot_extensions import Intersection, Not
@@ -515,8 +515,7 @@ def _(
515515

516516
#### Negative type and negative subtype
517517

518-
For negative contributions, this property is reversed. Here we can get remove superfluous
519-
_subtypes_:
518+
For negative contributions, this property is reversed. Here we can remove superfluous _subtypes_:
520519

521520
```py
522521
from knot_extensions import Intersection, Not

0 commit comments

Comments
 (0)