GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-26510: Add versionchanged for required arg of add_subparsers by adamjstewart · Pull Request #16588 · python/cpython

Conversation

@adamjstewart

@adamjstewart adamjstewart commented Oct 4, 2019 •
edited by miss-islington
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

The required argument to argparse.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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@adamjstewart
Add versionadded for required arg of add_subparsers
7e01621
@the-knights-who-say-ni

the-knights-who-say-ni commented Oct 4, 2019

Copy link
Copy Markdown

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 Missing

Our records indicate the following people have not signed the CLA:

@adamjstewart

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
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@the-knights-who-say-ni the-knights-who-say-ni added the CLA not signed label Oct 4, 2019
@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Oct 4, 2019
merwok
merwok requested changes Oct 4, 2019
View reviewed changes

@merwok merwok left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

adamjstewart reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting changes and removed awaiting review labels Oct 4, 2019
@bedevere-bot

bedevere-bot commented Oct 4, 2019

Copy link
Copy Markdown

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@merwok merwok changed the title Add versionadded for required arg of add_subparsers bpo-26510: Add versionadded for required arg of add_subparsers Oct 4, 2019
@merwok merwok added 🤖 automerge skip news and removed CLA not signed labels Oct 4, 2019
@the-knights-who-say-ni the-knights-who-say-ni added the CLA not signed label Oct 4, 2019
@merwok merwok self-assigned this Oct 4, 2019
@merwok merwok mentioned this pull request Oct 4, 2019
bpo-26510: Allow argparse add_subparsers to take required kwarg. #3027
Merged
@merwok

merwok commented Oct 4, 2019

Copy link
Copy Markdown
Member

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)

adamjstewart reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@merwok merwok mentioned this pull request Oct 4, 2019
bpo-33109: Remove now-obsolete What's New entry for bpo-26510. #7609
Merged
@adamjstewart

adamjstewart commented Oct 4, 2019

Copy link
Copy Markdown
Contributor Author

CLA has been signed 😄

merwok reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@merwok merwok removed the CLA not signed label Oct 4, 2019
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Oct 4, 2019
adamjstewart added 2 commits October 4, 2019 16:10
@adamjstewart
Update what's new note
319fd71
@adamjstewart
Add additional note since docs are long
1cd6722
@merwok

merwok commented Oct 4, 2019

Copy link
Copy Markdown
Member

Docs are a little vague indeed! From https://devguide.python.org/documenting/#paragraph-level-markup

versionadded
This directive documents the version of Python which added the described feature, or a part of it, to the library

But:

versionchanged
Similar to versionadded, but describes when and what changed in the named feature in some way (new parameters, changed side effects, platform support, etc.)

new parameters seems pretty clear here 🙂

I wouldn’t change FileType or other files in this PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

merwok
merwok reviewed Oct 4, 2019
View reviewed changes
Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

merwok
merwok reviewed Oct 4, 2019
View reviewed changes
Comment thread Doc/whatsnew/3.7.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@merwok

merwok commented Oct 4, 2019

Copy link
Copy Markdown
Member

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 🙂

aeros reacted with thumbs up emoji adamjstewart reacted with heart emoji
All reactions
  • 👍 1 reaction
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adamjstewart
Additional changes requested during code review
eb63af0
@adamjstewart adamjstewart changed the title bpo-26510: Add versionadded for required arg of add_subparsers bpo-26510: Add versionchanged for required arg of add_subparsers Oct 4, 2019
merwok
merwok approved these changes Oct 7, 2019
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting changes labels Oct 7, 2019
@miss-islington
miss-islington merged commit 9e71917 into python:master Oct 7, 2019
@miss-islington

miss-islington commented Oct 7, 2019

Copy link
Copy Markdown
Contributor

Thanks @adamjstewart for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label Oct 7, 2019
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 7, 2019
@adamjstewart @miss-islington
bpo-26510: Add versionchanged for required arg of add_subparsers (pyt…
8fb3f7d
…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]>
@bedevere-bot

bedevere-bot commented Oct 7, 2019

Copy link
Copy Markdown

GH-16608 is a backport of this pull request to the 3.8 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.8 label Oct 7, 2019
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 7, 2019
@adamjstewart @miss-islington
bpo-26510: Add versionchanged for required arg of add_subparsers (pyt…
9f7a2a0
…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]>
@bedevere-bot

bedevere-bot commented Oct 7, 2019

Copy link
Copy Markdown

GH-16609 is a backport of this pull request to the 3.7 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.7 label Oct 7, 2019
miss-islington added a commit that referenced this pull request Oct 7, 2019
@miss-islington @adamjstewart
bpo-26510: Add versionchanged for required arg of add_subparsers (GH-…
50b8d57
…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]>
miss-islington added a commit that referenced this pull request Oct 7, 2019
@miss-islington @adamjstewart
bpo-26510: Add versionchanged for required arg of add_subparsers (GH-…
f19b4d7
…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]>
merwok
merwok reviewed Oct 7, 2019
View reviewed changes
Comment thread Doc/whatsnew/3.7.rst
(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>`.

@merwok merwok Oct 7, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ned-deily pushed a commit to ned-deily/cpython that referenced this pull request Oct 14, 2019
@miss-islington @adamjstewart @ned-deily
bpo-26510: Add versionchanged for required arg of add_subparsers (pyt…
f168c17
…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]>
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
@adamjstewart Jake Taylor
bpo-26510: Add versionchanged for required arg of add_subparsers (py…
5b7179a
…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
@adamjstewart adamjstewart mentioned this pull request Aug 12, 2021
Use a patched argparse only in Python 2.X spack/spack#25376
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@merwok merwok merwok approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@merwok merwok

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@adamjstewart @the-knights-who-say-ni @bedevere-bot @merwok @miss-islington
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.