This is not a priority, but probably we could allow subclassing Callable, some people might find this "nicer", than defining a __call__ method (e.g. if this is an ABC or a protocol). For example this already works at runtime:
class C(Callable[[int], int]):
attr: str
This would be implemented by returning CallableType for C with a fallback to an instance of the original TypeInfo (like for tulpes, see also #3831).
This is not a priority, but probably we could allow subclassing
Callable, some people might find this "nicer", than defining a__call__method (e.g. if this is an ABC or a protocol). For example this already works at runtime:This would be implemented by returning
CallableTypeforCwith a fallback to an instance of the originalTypeInfo(like for tulpes, see also #3831).