Skip to content

cannot append list args to default_config_files #157

@tshu-w

Description

@tshu-w

🐛 Bug report

cannot append list args to default_config_files

To reproduce

from jsonargparse import CLI

def test_fn(
    nums: list[int] = [0],
    strs: list[str] = ["a"],
):
    pass

if __name__ == "__main__":
    CLI(test_fn, default_config_files=["config.yaml"])
nums:
- 1
strs:
- x
$ python test.py --nums+ 2 --print_config
nums:
- 2
strs:
- x

Expected behavior

python test.py --nums+ 2 --print_config got

nums:
- 1
- 2
strs:
- x

Environment

  • jsonargparse version: 4.13.2
  • Python version: 3.9.12
  • How jsonargparse was installed: pip install jsonargparse
  • OS: Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions