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
{{ message }}
Repository navigation
[mypyc] ... inferred type None; add an annotation on fully-annotated code #17216
$ mypyc test.py
test.py:3: error: Local variable "o" has inferred type None; add an annotation
mypyc doesn't like the annotation int | str | None (if you add something unrelated to the union that doesn't exhaust the if...elif stack, e.g. bytes, the error goes away). What would be an alternative annotation which could be used here that reflects int | str | None, apart from object or typing.Any?
Your Environment
Mypy version used: 1.10
Mypy command-line flags: None
Mypy configuration options from mypy.ini (and other config files): None
Activity
fix: annotated argument's `var` node type is explicit, not inferred (#…