Closed
Description
This simple example fails:
from typing import Type, Any, Callable
def f(func: Callable[[], Any]) -> Any: return func()
class C: pass
f(C) # This is okay
x = C()
f(type(x)) # E: Argument 1 to "f" has incompatible type Type[C]; expected Callable[[], Any]
X = C # type: Type[C]
f(X) # E: Argument 1 to "f" has incompatible type Type[C]; expected Callable[[], Any
This is actually present in the mypy test suite (test/test_random.py:49, the second argument to assertRaises()), so I'm treating this as a blocker.
Metadata
Metadata
Assignees
Labels
No labels