Skip to content

Argparse choices should be a sequence #92446

Description

@rhettinger

Documentation

Instead of saying "any container" is supported, refer only to "sequences".

Technically, a Container is only required to support __contains__ which is insufficent for argparse. Also, a sets do get accepted are a bad choice because the order shown in help and usage is non-deterministic. So, Sequence is the only reasonable choice because we need sizing and ordered iteration.

Linked PRs

Activity

  1. added
    docsDocumentation in the Doc dir
    3.11only security fixes
    3.12only security fixes
    on May 8, 2022
  2. added a commit that references this issue on May 13, 2022
  3. slateny commented on May 15, 2022

    @slateny
    Contributor

    Actually, the linked pr changes refer to lzma instead of argparse, was this intended?

  4. AA-Turner commented on May 16, 2022

    @AA-Turner
    Member

    On a quick review I'd also say that the change to lzma.rst should be reverted, as the option is in the context of .xz or .lzma container formats.

    A

  5. DanielNoord commented on Jul 7, 2022

    @DanielNoord
    Contributor

    Both #94561 and #94627 fix this.
    The latter seems better though as it is a little more thorough.

    I don't think any more PRs are needed, let's focus on merging either of these.

  6. added 5 commits that reference this issue on Dec 26, 2022
  7. added a commit that references this issue on Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10 (EOL)end of life3.11only security fixes3.12only security fixesdocsDocumentation in the Doc direasy

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions