We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from typing import Iterable, TypeVar, Callable, Iterator, Generic T = TypeVar("T") def gen(f: Callable, *args) -> Callable[[], Iterator[T]]: return lambda: f(*args)
Related question: is it currently possible to type argument f: Callable[..., Iterator[T]]?
f: Callable[..., Iterator[T]]
The text was updated successfully, but these errors were encountered:
Hmm, I don't think that PEP 484 says that Callable is a valid type, but mypy shouldn't crash when you try to use it. It should give an error.
Callable
Answer to the question: not yet, but it will become possible: #393
Sorry, something went wrong.
PEP 484 actually supports using Callable as a type, so mypy should support as well.
Callable should be equivalent to Callable[..., Any].
Callable[..., Any]
Support bare Callable
940318c
Fixes python#670.
ddfisher
No branches or pull requests
Related question: is it currently possible to type argument
f: Callable[..., Iterator[T]]
?The text was updated successfully, but these errors were encountered: