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
Bug Report
MyPy says a callable is not callable...
To Reproduce
https://mypy-play.net/?mypy=master&python=3.11&gist=f3a073087c600a0875ef54149ef27e24
from types import FunctionType from typing import Callable def show_annotations(func: Callable) -> None: if isinstance(func, FunctionType): print(func.__annotations__) else: print(func.__call__.__annotations__) # ✘ error [operator] class Foo: def __call__(self) -> None: pass def foo() -> None: pass show_annotations(foo) show_annotations(Foo())
Expected Behavior
The code looks good to me, typing-wise.
Actual Behavior
main.py:9: error: "Callable[..., Any]" not callable [operator] Found 1 error in 1 file (checked 1 source file)
The text was updated successfully, but these errors were encountered:
Duplicate of #5079
Sorry, something went wrong.
No branches or pull requests
Bug Report
MyPy says a callable is not callable...
To Reproduce
https://mypy-play.net/?mypy=master&python=3.11&gist=f3a073087c600a0875ef54149ef27e24
Expected Behavior
The code looks good to me, typing-wise.
Actual Behavior
The text was updated successfully, but these errors were encountered: