You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
classC(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).
The text was updated successfully, but these errors were encountered:
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
CallableType
forC
with a fallback to an instance of the originalTypeInfo
(like for tulpes, see also #3831).The text was updated successfully, but these errors were encountered: