[red-knot] improve function/bound method type display (#17294)

## Summary

* Partial #17238
* Flyby from discord discussion - `todo_type!` now statically checks for
no parens in the message to avoid issues between debug & release build
tests

## Test Plan

many mdtests are changing
This commit is contained in:
Mike Perlov
2025-04-14 18:56:18 -04:00
committed by GitHub
parent b5d529e976
commit 3b24fe5c07
29 changed files with 181 additions and 133 deletions

View File

@@ -289,7 +289,7 @@ def _(c: Callable[[int, Unpack[Ts]], int]):
from typing import Callable
def _(c: Callable[[int], int]):
reveal_type(c.__init__) # revealed: Literal[__init__]
reveal_type(c.__init__) # revealed: def __init__(self) -> None
reveal_type(c.__class__) # revealed: type
# TODO: The member lookup for `Callable` uses `object` which does not have a `__call__`