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
Union[Literal, ...]
To Reproduce
from dataclasses import dataclass from typing import Literal, Union import simple_parsing @dataclass class Foo: bar: Union[Literal["a"], dict] = "a" parser = simple_parsing.ArgumentParser() parser.add_arguments( Foo, dest="foo", default=Foo(), ) parser.parse_args()
Expected behavior The code should run, just like it does if I replace Union[Literal["a"], dict] with Literal["a"]
Union[Literal["a"], dict]
Literal["a"]
Actual behavior
$ python issue.py Couldn't parse value a, returning the value as-is. (exceptions: [TypeError('Cannot instantiate typing.Literal'), ValueError('dictionary update sequence element #0 has length 1; 2 is required')]) usage: test.py [-h] [--bar Literal|dict] test.py: error: argument --bar: invalid Literal|dict value: 'a'
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
Revert "Adjust multifun"
dd6b835
This reverts commit c7a2f15. Work around lebrice/SimpleParsing#322
Add test to repro #322
1a8f5c6
Signed-off-by: Fabrice Normandin <[email protected]>
Attempt to work around lebrice/SimpleParsing#322
7d19194
No branches or pull requests
To Reproduce
Expected behavior
The code should run, just like it does if I replace
Union[Literal["a"], dict]
withLiteral["a"]
Actual behavior
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: