You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reference for the nargs parameter of add_argument does not include the case when nargs is '...'. A pull request is provided that adds this case to the documentation, including an example of the use.
This was explicitly made undocumented in #61252 / #18661
I would not have made that decision, since argparse.REMAINDER is both useful and very widely used: tens of thousands of hits on https://github.com/search?q=argparse.REMAINDER&type=code. But given that a decision was made by a core dev, I'd feel uncomfortable simply reverting #18661 without more consensus from some other core developers.
Absent that, if someone is interested in picking this up, I think a viable path forward could be to go through these issues https://github.com/python/cpython/issues?q=is%3Aissue+is%3Aopen+argparse.REMAINDER , figure out which ones are definitely bugs and which ones are subideal behaviour that we're stuck with. If we can show we're comfortable with how argparse.REMAINDER works and we expand test coverage, I think that would be a strong reason for redocumenting.
Documentation
The reference for the
nargs
parameter ofadd_argument
does not include the case whennargs
is'...'
. A pull request is provided that adds this case to the documentation, including an example of the use.Linked PRs
The text was updated successfully, but these errors were encountered: