ty
ty copied to clipboard
Bidirectional inference fails in assignments that use unpacking
E.g.
from typing import TypedDict
class Foo(TypedDict):
x: int
x: Foo
# error: Object of type `dict[Unknown | str, Unknown | int]` is not assignable to `Foo`
x, _ = {"x": 42}, 56
Probably not a top priority, but an inconsistency I noticed when looking at https://github.com/astral-sh/ty/issues/2161