ruff/crates/ty_python_semantic/resources/mdtest/narrow
Shunsuke Shibayama 342b2665db
[ty] basic narrowing on attribute and subscript expressions (#17643)
## Summary

This PR closes astral-sh/ty#164.

This PR introduces a basic type narrowing mechanism for
attribute/subscript expressions.
Member accesses, int literal subscripts, string literal subscripts are
supported (same as mypy and pyright).

## Test Plan

New test cases are added to `mdtest/narrow/complex_target.md`.

---------

Co-authored-by: David Peter <mail@david-peter.de>
2025-06-17 11:07:46 +02:00
..
conditionals [ty] basic narrowing on attribute and subscript expressions (#17643) 2025-06-17 11:07:46 +02:00
assert.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
assignment.md [ty] basic narrowing on attribute and subscript expressions (#17643) 2025-06-17 11:07:46 +02:00
bool-call.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
boolean.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
complex_target.md [ty] basic narrowing on attribute and subscript expressions (#17643) 2025-06-17 11:07:46 +02:00
hasattr.md [ty] Only consider a type T a subtype of a protocol P if all of P's members are fully bound on T (#18466) 2025-06-04 19:39:14 +00:00
isinstance.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
issubclass.md Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
match.md [ty] Understand classes that inherit from subscripted Protocol[] as generic (#17832) 2025-05-09 17:39:15 +01:00
post_if_statement.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
truthiness.md [ty] Reachability constraints (#18621) 2025-06-17 09:24:28 +02:00
type.md [ty] Reachability constraints (#18621) 2025-06-17 09:24:28 +02:00
type_guards.md [ty] basic narrowing on attribute and subscript expressions (#17643) 2025-06-17 11:07:46 +02:00
while.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00