ruff/crates/red_knot_python_semantic/resources/mdtest
Alex Waygood f85ea1bf46
[red-knot] Ensure differently ordered unions and intersections are understood as equivalent even inside arbitrarily nested tuples (#15740)
## Summary

On `main`, red-knot:
- Considers `P | Q` equivalent to `Q | P`
- Considered `tuple[P | Q]` equivalent to `tuple[Q | P]`
- Considers `tuple[P | tuple[P | Q]]` equivalent to `tuple[tuple[Q | P]
| P]`
- ‼️ Does _not_ consider `tuple[tuple[P | Q]]` equivalent to
`tuple[tuple[Q | P]]`

The key difference for the last one of these is that the union appears
inside a tuple that is directly nested inside another tuple.

This PR fixes this so that differently ordered unions are considered
equivalent even when they appear inside arbitrarily nested tuple types.

## Test Plan

- Added mdtests that fails on `main`
- Checked that all property tests continue to pass with this PR
2025-01-25 16:39:07 +00:00
..
annotations [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
assignment [red-knot] add call checking (#15200) 2025-01-07 20:39:45 +00:00
binary [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
boolean [red-knot] Statically known branches (#15019) 2024-12-21 11:33:10 +01:00
boundness_declaredness [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
call [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
comparison [red-knot] Simplify object out of intersections (#15511) 2025-01-15 20:06:48 +00:00
comprehensions [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
conditional [red-knot] fix control flow for assignment expressions in elif tests (#15274) 2025-01-05 18:35:29 +00:00
declaration [red-knot] Avoid undeclared path when raising conflicting declarations (#14958) 2024-12-17 09:49:39 +05:30
directives [red-knot] Ensure differently ordered unions and intersections are considered equivalent (#15516) 2025-01-19 16:10:42 +00:00
exception [red-knot] Report invalid exceptions (#15042) 2024-12-18 18:31:24 +00:00
expression [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
function [red-knot] function parameter types (#14802) 2024-12-06 12:55:56 -08:00
import [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
literal [red-knot] Migrate bool/str/repr unit tests to Markdown tests (#15534) 2025-01-16 11:21:56 -08:00
loops [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
narrow [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
regression [red-knot] Do not attach diagnostics to wrong file (#14337) 2024-11-14 15:39:51 +01:00
scopes [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
shadowing Test explicit shadowing involving defs (#15174) 2024-12-29 00:47:03 +00:00
stubs Allow assigning ellipsis literal as parameter default value (#14982) 2025-01-05 13:11:32 -06:00
subscript [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
suppressions [red-knot] Add --ignore, --warn, and --error CLI arguments (#15689) 2025-01-24 16:20:15 +01:00
type_of [red-knot] Pure instance variables declared in class body (#15515) 2025-01-17 10:48:20 +01:00
type_properties [red-knot] Ensure differently ordered unions and intersections are understood as equivalent even inside arbitrarily nested tuples (#15740) 2025-01-25 16:39:07 +00:00
type_qualifiers [red-knot] Add support for typing.ClassVar (#15550) 2025-01-18 13:51:35 +01:00
unary [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
with [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
.mdformat.toml [red-knot] have mdformat wrap mdtest files to 100 columns (#14020) 2024-10-31 21:00:51 +00:00
attributes.md [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
final.md [red-knot] Add support for @final classes (#15070) 2024-12-19 21:02:14 +00:00
generics.md [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
intersection_types.md [red-knot] Simplify object out of intersections (#15511) 2025-01-15 20:06:48 +00:00
invalid_syntax.md [red-knot] Separate invalid syntax code snippets (#14803) 2024-12-06 02:41:33 +00:00
known_constants.md [red-knot] Support typing.TYPE_CHECKING (#14952) 2024-12-13 09:24:48 +00:00
mdtest_config.md Rename custom-typeshed-dir, target-version and current-directory CLI options (#14930) 2024-12-13 08:21:52 +00:00
mdtest_custom_typeshed.md [red-knot] Support custom typeshed Markdown tests (#15683) 2025-01-23 12:36:38 +01:00
metaclass.md [red-knot] More precise inference for classes with non-class metaclasses (#15138) 2025-01-09 00:34:04 +00:00
mro.md [red-knot] No cyclic-class-def diagnostics for subclasses of cyclic classes (#15561) 2025-01-20 13:35:29 +00:00
pep695_type_aliases.md [red-knot] Move type_alias_types test to Markdown (#15607) 2025-01-20 09:55:54 +01:00
slots.md [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
statically_known_branches.md [red-knot] MDTests: Do not depend on precise public-symbol type inference (#15691) 2025-01-23 13:51:33 +00:00
sys_platform.md [red-knot] Typeshed sync and sys.platform fixes (#15492) 2025-01-15 11:21:01 +01:00
sys_version_info.md [red-knot] Pure instance variables declared in class body (#15515) 2025-01-17 10:48:20 +01:00
type_api.md [red-knot] Add AlwaysTruthy and AlwaysFalsy to knot_extensions (#15437) 2025-01-12 17:00:57 +00:00
union_types.md [red-knot] Move intersection type tests to Markdown (#15396) 2025-01-10 14:04:03 +01:00
unpacking.md Display Union of Literals as a Literal (#14993) 2025-01-08 00:58:38 +00:00