ruff/crates/red_knot_python_semantic/resources/mdtest/narrow
Matthew Mckee 5853eb28dd
[red-knot] allow assignment expression in call compare narrowing (#17461)
## Summary

There was some narrowing constraints not covered from the previous PR

```py
def _(x: object):
    if (type(y := x)) is bool:
        reveal_type(y)  # revealed: bool
```

Also, refactored a bit

## Test Plan

Update type_api.md
2025-04-18 08:46:15 -07:00
..
conditionals [red-knot] Add some narrowing for assignment expressions (#17448) 2025-04-17 17:28:06 -07:00
assert.md [red-knot] Type narrowing for assertions (take 2) (#17345) 2025-04-18 08:11:07 -07:00
bool-call.md [red-knot] Support multiple overloads when binding parameters at call sites (#16568) 2025-03-11 15:08:17 -04:00
boolean.md [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
isinstance.md Teach red-knot that type(x) is the same as x.__class__ (#16301) 2025-02-21 21:05:48 +00:00
issubclass.md [red-knot] detect invalid return type (#16540) 2025-03-12 01:58:59 +00:00
match.md [red-knot] more type-narrowing in match statements (#17302) 2025-04-17 18:18:34 -07:00
post_if_statement.md Improve mdtests style (#14884) 2024-12-10 13:05:51 +00:00
truthiness.md [red-knot] Add support for overloaded functions (#17366) 2025-04-18 09:57:40 +05:30
type.md [red-knot] allow assignment expression in call compare narrowing (#17461) 2025-04-18 08:46:15 -07:00
while.md [red-knot] detect invalid return type (#16540) 2025-03-12 01:58:59 +00:00