Hi,
When using a param of type list
and adding default values in the definition of the param, when invoking the task with list values you specified in the command line, it does not create a new list, but appends to the default list.
doit.py
from doit import task_params
@task_params([{'name': 'some_list', 'type': list, 'default': ['item1', 'item2'], 'short': 'l'}])
def task_list_with_duplicates(some_list):
for l in some_list:
yield {
'name': f'name_of_list_{l}',
'actions': [f'echo "some action on list {l}"'],
'verbosity': 2
}
Execution
> doit list_with_duplicates -l item1
ERROR: Task generation 'list_with_duplicates' has duplicated definition of 'list_with_duplicates:name_of_list_item1'
Environment
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too