ruff/crates/red_knot_python_semantic/resources/mdtest
David Peter d8538d8c98
[red-knot] Narrowing for type(x) is C checks (#14432)
## Summary

Add type narrowing for `type(x) is C` conditions (and `else` clauses of
`type(x) is not C` conditionals):

```py
if type(x) is A:
    reveal_type(x)  # revealed: A
else:
    reveal_type(x)  # revealed: A | B
```

closes: #14431, part of: #13694

## Test Plan

New Markdown-based tests.
2024-11-18 16:21:46 +01:00
..
annotations Understand typing.Optional in annotations (#14397) 2024-11-17 17:04:58 +00:00
assignment [red-knot] Add support for string annotations (#14151) 2024-11-15 04:10:18 +00:00
binary
boolean
call [red-knot] function signature representation (#14304) 2024-11-14 23:34:24 +00:00
comparison [red-knot] Shorten the paths for some mdtest files (#14267) 2024-11-11 11:34:33 +00:00
conditional
declaration
exception [red-knot] function signature representation (#14304) 2024-11-14 23:34:24 +00:00
expression [red-knot] Review remaining 'possibly unbound' call sites (#14284) 2024-11-11 20:48:49 +01:00
import [red-knot] Diagnostic for possibly unbound imports (#14281) 2024-11-11 20:26:01 +01:00
literal [red-knot] Types for subexpressions of annotations (#14426) 2024-11-18 13:03:27 +01:00
loops [red-knot] Shorten the paths for some mdtest files (#14267) 2024-11-11 11:34:33 +00:00
narrow [red-knot] Narrowing for type(x) is C checks (#14432) 2024-11-18 16:21:46 +01:00
regression [red-knot] Do not attach diagnostics to wrong file (#14337) 2024-11-14 15:39:51 +01:00
scopes [red-knot] Review remaining 'possibly unbound' call sites (#14284) 2024-11-11 20:48:49 +01:00
shadowing
stubs
subscript
unary [red-knot] Infer unary not operation for instances (#13827) 2024-11-13 23:31:36 +00:00
with [red-knot] Shorten the paths for some mdtest files (#14267) 2024-11-11 11:34:33 +00:00
.mdformat.toml
attributes.md [red-knot] Add tests for member lookup on union types (#14296) 2024-11-12 14:11:55 +01:00
generics.md [red-knot] function signature representation (#14304) 2024-11-14 23:34:24 +00:00
metaclass.md [red-knot] Improve error message for metaclass conflict (#14174) 2024-11-08 11:58:57 +00:00
mro.md
sys_version_info.md [red-knot] Default to python 3.9 (#14429) 2024-11-18 11:27:40 +00:00
unpacking.md