-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
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
Make parsing parameter from CLI work properly when it is a list #128
Make parsing parameter from CLI work properly when it is a list #128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a test for this, please?
AFAIK nargs="+"
will assume the user enters the argument as
$ python foo.py --my-list-argument a b c d --other-argument blah
so a test would at least demonstrate that that's the way to use this feature.
abb58b0
to
7595c81
Compare
@akx I changed the approach and also described it in the PR description |
I emdraftened this – I think we need to design this new |
Good to know that we have to document it publicly 👍 . My idea is |
7595c81
to
fd688c9
Compare
@akx I reduce the scope of this PR now to only parse the parameter's value using comma as default. We will make further changes once we find out a good way to get |
When the values of a parameter are provided via CLI, split them into a list properly with the default separator is a comma
fd688c9
to
20fe008
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Let
argparser
knows how to properly parse the parameter of typelist
by providing a callback that split the parameter using comma as default.