AnswerDotAI / AnswerDotAI/fastcore
using `*args` with `@call_parse`
- Dominant language
- Jupyter Notebook
- Stars
- 1.1k
- Forks
- 295
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 7
Description
I am trying to the use the `call_parse` decorator with `*args` and I can't seem to figure how to make it work. Here is the function definition,
```python
@call_parse
def timesheet(*args):
pass
```
When I call the function in the nb, there's no problem,
```
timesheet(2, 'OH', 3, 'CSDP', 3, 'OR')
```
however, while calling the functions from the terminal becomes a problem
```
(base) devengqc@17-CN0065CL-1:~/git/projects/personal$ timesheet --args "2, 'OH', 3, 'CSDP', 3, 'OR'"
usage: timesheet [-h] args
timesheet: error: argument args: invalid _empty value: "2, 'OH', 3, 'CSDP', 3, 'OR'"
```
I've tried other combinations as well in the terminal and they don't seem to work. Is there a way around this? Or am I doing something wrong?
Contributor guide
Research direction
Start with the @call_parse entry point and reproduce the terminal invocation shown in the issue, comparing it with the notebook call to timesheet. Trace how *args is parsed and identify whether the behavior is supported; done means the supported invocation or a clear limitation and workaround are established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100