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
fromtypingimportType, Any, Callabledeff(func: Callable[[], Any]) ->Any: returnfunc()
classC: passf(C) # This is okayx=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.
I can't figure out how to solve this quickly, so I'm going to use the # type: ignore for the one place in the mypy test suite where this causes a problem ( in test-data/stdlib-samples/3.2/test/test_random.py).
Activity
gvanrossum commentedon Jul 12, 2016
I can't figure out how to solve this quickly, so I'm going to use the
# type: ignorefor the one place in the mypy test suite where this causes a problem ( in test-data/stdlib-samples/3.2/test/test_random.py).Add band-aid type-ignore to make tests pass. See #1846.
Sync typeshed (#1849)
JukkaL commentedon Jul 13, 2016
#1670 is related.
gvanrossum commentedon Jul 13, 2016
Closing as duplicate of #1670 (comment).