jsonargparse
jsonargparse copied to clipboard
Mypy: `DictComponentsType["_help"]` is not expressed in type declaration
🐛 Bug report
The type for DictComponentsType doesn't allow the "_help": str entry:
ComponentType = Union[Callable, Type]
DictComponentsType = Dict[str, Union[ComponentType, "DictComponentsType"]]
To reproduce
from jsonargparse import CLI
CLI({"something": {"_help": "Help"}})
> python -m mypy .
...error: Dict entry 0 has incompatible type "str": "str"; expected "str": "Callable[..., Any] | type[Any] | DictComponentsType"