Skip to content

bpo-9694: Fix misleading phrase "optional arguments" #23858

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

Merged
merged 4 commits into from
Dec 23, 2020

Conversation

rhettinger
Copy link
Contributor

@rhettinger rhettinger commented Dec 19, 2020

https://bugs.python.org/issue9694

I still need to change the examples in the main docs and add an introductory sentence or two explaining the terminology. Will wait until further discussions are complete before making those edits.

@@ -468,7 +468,7 @@ verbosity argument (check the output of ``python --help``)::
print(answer)

We have introduced another action, "count",
to count the number of occurrences of a specific optional arguments:
to count the number of occurrences of a specific options:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old version has this issue, too: shouldn't this be singular "options", or maybe "occurrences of specific options" (omitting "a")?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense.

Copy link
Member

@ericvsmith ericvsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I'm leaving this as two reviews: I pressed the wrong button on the first one.

Two little nits, otherwise looks good.

@@ -0,0 +1 @@
Argparse help no longer use the confusing phrase, "optional arguments".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should add: ', it now uses "options".'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

@rhettinger rhettinger merged commit 41b223d into python:master Dec 23, 2020
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
mikelolasagasti added a commit to mikelolasagasti/sphinx-argparse that referenced this pull request Nov 13, 2021
This PR changed the "optional arguments" to "optional" in 3.10, breaking
some tests.

python/cpython#23858
mikelolasagasti added a commit to mikelolasagasti/sphinx-argparse that referenced this pull request Nov 13, 2021
This PR changed the "optional arguments" to "optional" in 3.10, breaking
some tests.

python/cpython#23858
inglor added a commit to inglor/in-toto that referenced this pull request Dec 5, 2021
Optional Arguments was renamed to Options in python 3.10 release [1]

[1]: python/cpython#23858

Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com>
inglor added a commit to inglor/in-toto that referenced this pull request Dec 6, 2021
Optional Arguments was renamed to Options in python 3.10 release [1]

[1]: python/cpython#23858

Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com>
eli-schwartz added a commit to mesonbuild/meson that referenced this pull request Jan 25, 2022
In python/cpython#23858 the section header for
option flags was changed from "optional arguments" to "options" with the
rationale that they are not (necessarily) at all optional, while GNU
coreutils calls them options.

In fact, POSIX calls them options (-o) and option-arguments (-o val) and
operands ("positional arguments") so it is indeed a mess, but argparse
is not yet perfect.

Still, fix the documentation generator for now so that it is compatible
with python 3.10 as well.

Fixes traceback on building the docs with:

```
[1/4] Generating gen_docs with a custom command
FAILED: gen_docs.stamp
/home/eschwartz/git/meson/docs/../tools/regenerate_docs.py --output-dir /home/eschwartz/git/meson/docs/builddir --dummy-output-file gen_docs.stamp
Traceback (most recent call last):
  File "/home/eschwartz/git/meson/docs/../tools/regenerate_docs.py", line 160, in <module>
    regenerate_docs(output_dir=args.output_dir,
  File "/home/eschwartz/git/meson/docs/../tools/regenerate_docs.py", line 146, in regenerate_docs
    generate_hotdoc_includes(root_dir, output_dir)
  File "/home/eschwartz/git/meson/docs/../tools/regenerate_docs.py", line 113, in generate_hotdoc_includes
    cmd_data = get_commands_data(root_dir)
  File "/home/eschwartz/git/meson/docs/../tools/regenerate_docs.py", line 106, in get_commands_data
    cmd_data[cmd] = parse_cmd(cmd_output)
  File "/home/eschwartz/git/meson/docs/../tools/regenerate_docs.py", line 65, in parse_cmd
    assert arguments_start
AssertionError
```
openstack-mirroring pushed a commit to openstack/python-glanceclient that referenced this pull request Jan 12, 2023
First, fix test_help(). A commit[1], which first appeared in Python
3.10, changes the output of the help feature of argparse. Options used
to be in a section named "Optional arguments:", and they are now in a
section named "Options:".

Second, tox 4 changes the behaviour of tox, and
{toxinidir}/requirements.txt is no longer installed automagically in the
docs virtual environment. This causes autodoc to fail on some imports.
We explicitely add {toxinidir}/requirements.txt to the list of
dependencies to fix this issue.

These issues should be fixed in separate patches, but since they both
block the CI, they depend on each other.

[1] python/cpython#23858

Change-Id: Ia7866390b31f469bdea95624325a13aaf45a496e
Closes-Bug: #2002566
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Jan 12, 2023
* Update python-glanceclient from branch 'master'
  to 6c95122777c8449056115292b492ec3e1e0d6e50
  - Fix functional tests and docs generation
    
    First, fix test_help(). A commit[1], which first appeared in Python
    3.10, changes the output of the help feature of argparse. Options used
    to be in a section named "Optional arguments:", and they are now in a
    section named "Options:".
    
    Second, tox 4 changes the behaviour of tox, and
    {toxinidir}/requirements.txt is no longer installed automagically in the
    docs virtual environment. This causes autodoc to fail on some imports.
    We explicitely add {toxinidir}/requirements.txt to the list of
    dependencies to fix this issue.
    
    These issues should be fixed in separate patches, but since they both
    block the CI, they depend on each other.
    
    [1] python/cpython#23858
    
    Change-Id: Ia7866390b31f469bdea95624325a13aaf45a496e
    Closes-Bug: #2002566
tsibley added a commit to nextstrain/cli that referenced this pull request Feb 27, 2023
The section heading used in argparse's formatted help output changed in
3.10¹, rendering --help equivalent to --help-all.  This affected anyone
with Nextstrain CLI installed on Python 3.10 or newer, including our
standalone installation binaries.

¹ <python/cpython#23858>
  <https://bugs.python.org/issue9694>
tsibley added a commit to nextstrain/cli that referenced this pull request Feb 28, 2023
The section heading used in argparse's formatted help output changed in
3.10¹, rendering --help equivalent to --help-all.  This affected anyone
with Nextstrain CLI installed on Python 3.10 or newer, including our
standalone installation binaries.

¹ <python/cpython#23858>
  <https://bugs.python.org/issue9694>
tsibley added a commit to nextstrain/cli that referenced this pull request Feb 28, 2023
The section heading used in argparse's formatted help output changed in
3.10¹, rendering --help equivalent to --help-all.  This affected anyone
with Nextstrain CLI installed on Python 3.10 or newer, including our
standalone installation binaries.

¹ <python/cpython#23858>
  <https://bugs.python.org/issue9694>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants