-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-26510: Add versionchanged for required arg of add_subparsers #16588
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
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
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.
Thanks for adding this piece that was missed in the original PR!
Because this part of the docs is super long, could you also add something like (added in 3.7)
on line 1639? Would help readers get the version info right when they read about required
.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
The what’s new note was removed by #7609 after the default value was changed in #6919, but now I realize that this was too much: subparsers are not required, but there is a new param! Would you @adamjstewart mind re-adding a note in what’s new for 3.7? (also please say if you need any help with the CLA) |
CLA has been signed 😄 |
Docs are a little vague indeed! From https://devguide.python.org/documenting/#paragraph-level-markup
But:
I wouldn’t change FileType or other files in this PR. |
A note about the review: these are all quite minor changes! I could do them myself by adding commits to the branch directly, but in general I prefer to have a discussion and let the contributor own their PR, unless they are not interested in or don’t have for tiny details, in which case I’m happy to polish and merge 🙂 |
Thanks @adamjstewart for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
…honGH-16588) The `required` argument to `argparse.add_subparsers` was added in pythonGH-3027. This PR specifies the earliest version of Python where it is available. https://bugs.python.org/issue26510 Automerge-Triggered-By: @merwok (cherry picked from commit 9e71917) Co-authored-by: Adam J. Stewart <[email protected]>
GH-16608 is a backport of this pull request to the 3.8 branch. |
…honGH-16588) The `required` argument to `argparse.add_subparsers` was added in pythonGH-3027. This PR specifies the earliest version of Python where it is available. https://bugs.python.org/issue26510 Automerge-Triggered-By: @merwok (cherry picked from commit 9e71917) Co-authored-by: Adam J. Stewart <[email protected]>
GH-16609 is a backport of this pull request to the 3.7 branch. |
…16588) The `required` argument to `argparse.add_subparsers` was added in GH-3027. This PR specifies the earliest version of Python where it is available. https://bugs.python.org/issue26510 Automerge-Triggered-By: @merwok (cherry picked from commit 9e71917) Co-authored-by: Adam J. Stewart <[email protected]>
…16588) The `required` argument to `argparse.add_subparsers` was added in GH-3027. This PR specifies the earliest version of Python where it is available. https://bugs.python.org/issue26510 Automerge-Triggered-By: @merwok (cherry picked from commit 9e71917) Co-authored-by: Adam J. Stewart <[email protected]>
@@ -2401,6 +2401,10 @@ Changes in the Python API | |||
instead of a :class:`bytes` instance. | |||
(Contributed by Victor Stinner in :issue:`21071`.) | |||
|
|||
* :mod:`argparse` subparsers can now be made mandatory by passing ``required=True`` | |||
to :meth:`ArgumentParser.add_subparsers() <argparse.ArgumentParser.add_subparsers>`. |
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.
Small thing I didn’t notice before merge: in func/meth/etc roles, we don’t include the parentheses. Sphinx has a setting to add them or not automatically to all roles (I think it’s smart enough to not add them if already present, but not 100% sure, will check when the docs rebuild is published).
(I personnally don’t like to have them, especially given Python’s clear difference of referencing a function vs. calling it, but many programmers are used to writing things like the whatever() function
probably to make it less ambiguous in plain text contexts like email, so Python’s doc is set up to have them 🙂)
I didn’t pay attention to the fact that the section here (Changes in the Python API
) was part of Porting to Python 3.7
(we really need docs previews for PRs!), which made sense in the original PR (changed argparse behaviour) but less so now. I think it would have been better in Improved Modules
→ argparse
https://docs.python.org/3.9/whatsnew/3.7.html#argparse
…honGH-16588) The `required` argument to `argparse.add_subparsers` was added in pythonGH-3027. This PR specifies the earliest version of Python where it is available. https://bugs.python.org/issue26510 Automerge-Triggered-By: @merwok (cherry picked from commit 9e71917) Co-authored-by: Adam J. Stewart <[email protected]>
…thonGH-16588) The `required` argument to `argparse.add_subparsers` was added in python#3027. This PR specifies the earliest version of Python where it is available. https://bugs.python.org/issue26510 Automerge-Triggered-By: @merwok
The
required
argument toargparse.add_subparsers
was added in #3027. This PR specifies the earliest version of Python where it is available.https://bugs.python.org/issue26510
Automerge-Triggered-By: @merwok