ruff
52b04708 - [red-knot] Synthesize a `__call__` attribute for Callable types (#17809)

Commit
133 days ago
[red-knot] Synthesize a `__call__` attribute for Callable types (#17809) ## Summary Currently this assertion fails on `main`, because we do not synthesize a `__call__` attribute for Callable types: ```py from typing import Protocol, Callable from knot_extensions import static_assert, is_assignable_to class Foo(Protocol): def __call__(self, x: int, /) -> str: ... static_assert(is_assignable_to(Callable[[int], str], Foo)) ``` This PR fixes that. See previous discussion about this in https://github.com/astral-sh/ruff/pull/16493#discussion_r1985098508 and https://github.com/astral-sh/ruff/pull/17682#issuecomment-2839527750 ## Test Plan Existing mdtests updated; a couple of new ones added.
Author
Parents
Loading