← 返回首页
Argparse choices should be a sequence · Issue #92446 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Argparse choices should be a sequence #92446

New issue
New issue

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10only security fixes3.11only security fixes3.12only security fixesdocsDocumentation in the Doc direasy

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Doc issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    • Open in GitHub Copilot app

    Footer

    © 2026 GitHub, Inc.