diff --git a/src/tyro/_cli.py b/src/tyro/_cli.py index c8b0d347..680e238f 100644 --- a/src/tyro/_cli.py +++ b/src/tyro/_cli.py @@ -324,9 +324,6 @@ def _cli_impl( if not arg.startswith("--"): continue - delimeter = _strings.get_delimeter() - to_swap_delimeter = "-" if delimeter == "_" else "_" - if "=" in arg: arg, _, val = arg.partition("=") fixed = "--" + _strings.replace_delimeter_in_part(arg[2:]) + "=" + val diff --git a/tests/test_collections.py b/tests/test_collections.py index a8782c0e..e4aa3fe8 100644 --- a/tests/test_collections.py +++ b/tests/test_collections.py @@ -467,8 +467,10 @@ def main(x: tuple = ()) -> Any: assert tyro.cli(main, args="--x 0 1 2 3".split(" ")) == ("0", "1", "2", "3") + def test_narrowing_edge_case() -> None: """https://github.com/brentyi/tyro/issues/136""" + @dataclasses.dataclass class Config: _target: Type = dataclasses.field(default_factory=lambda: MyClass)