Skip to content
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

Add nargs='...' to the reference of add_argument in argparse #101472

Open
ppaez opened this issue Jan 31, 2023 · 1 comment
Open

Add nargs='...' to the reference of add_argument in argparse #101472

ppaez opened this issue Jan 31, 2023 · 1 comment
Labels
docs Documentation in the Doc dir

Comments

@ppaez
Copy link
Contributor

ppaez commented Jan 31, 2023

Documentation

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.

Linked PRs

@hauntsaninja
Copy link
Contributor

hauntsaninja commented Apr 19, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
Status: Doc issues
Development

No branches or pull requests

2 participants