New issue
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
alt.Color fails mypy --strict with error: Call to untyped function "Color" in typed context [no-untyped-call] #3408
Comments
Weird, |
It also seems to fail pyright, erroring for all three arguments. In case it helps, here's the output from various type checkers, using
pyright 1.1.360:
mypy 1.9.0 (compiled: yes), with --strict:
pytype 2024.04.11
|
Thanks! Those outputs were very helpful. I think mypy at least thinks that Is this blocking you from using Altair or can you |
Not a blocker for me at all! As you say, I can just type ignore. |
What happened?
I use altair in my project, which is typedchecked with mypy strict mode. When I have a graph in that project which uses alt.Color, I get
error: Call to untyped function "Color" in typed context [no-untyped-call]
from mypy --strict. Oddly, this does not happen to other alt.Whatever objects, only color. I can't be sure if this is an altair bug or a mypy bug, to be honest.Here's a minimal example:
Results from mypy version 1.9.0 (compiled: yes):
What would you like to happen instead?
The types should be annotated appropriately so Color is deduced to be a typed function and therefore mypy strict would not report an error.
I'm not sure exactly what this would involve. https://peps.python.org/pep-0484/ says the return type of init ought to be
None
, so that's somewhere to start, maybe, perhaps.Which version of Altair are you using?
5.3.0
The text was updated successfully, but these errors were encountered: