Title: Clarify argparse's append action · Issue #139067 · python/cpython · GitHub
Open Graph Title: Clarify argparse's append action · Issue #139067 · python/cpython
X Title: Clarify argparse's append action · Issue #139067 · python/cpython
Description: Documentation The documentation for argparse's append action when a default value is provided is unclear Currently the docs state: 'append' - This stores a list, and appends each argument value to the list. It is useful to allow an optio...
Open Graph Description: Documentation The documentation for argparse's append action when a default value is provided is unclear Currently the docs state: 'append' - This stores a list, and appends each argument value to ...
X Description: Documentation The documentation for argparse's append action when a default value is provided is unclear Currently the docs state: 'append' - This stores a list, and appends each argume...
Opengraph URL: https://github.com/python/cpython/issues/139067
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Clarify argparse's append action","articleBody":"# Documentation\n\nThe documentation for argparse's `append` action when a default value is provided is unclear \n\nCurrently the [docs](https://docs.python.org/3/library/argparse.html#action) state:\n\n> 'append' - This stores a list, and appends each argument value to the list. It is useful to allow an option to be specified multiple times. If the default value is non-empty, the default elements will be present in the parsed value for the option, with any values from the command line appended after those default values. Example usage:\n\n```\nparser = argparse.ArgumentParser()\nparser.add_argument('--foo', action='append')\nparser.parse_args('--foo 1 --foo 2'.split())\nNamespace(foo=['1', '2'])\n```\n\nHowever, this documentation does not specify that the default needs to be a list, and cannot be a single value. While this may be obvious in hindsight, a short example would entirely remove this source of confusion.\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-131389\n* gh-139068\n* gh-139069\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/moshekaplan","@type":"Person","name":"moshekaplan"},"datePublished":"2025-09-17T16:21:33Z","url":"https://github.com/python/cpython/issues/139067"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:506cf5ee-b03e-c044-93d9-047f8b236f2b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B03E:CC1A4:3C021D7:4C50D79:6B020361 |
| html-safe-nonce | 895c190b5b6640bc837ee046fa1ed1c473855f060db2e7316c1dc483f5c6aa30 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDNFOkNDMUE0OjNDMDIxRDc6NEM1MEQ3OTo2QjAyMDM2MSIsInZpc2l0b3JfaWQiOiIyNzkyNzcyODMzNTY1MDgyNDY1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5ce1edc0be230787e41408e10a04169dbf561e7daa6876f960e2572e8acf4336 |
| hovercard-subject-tag | issue:3426974431 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/139067/issue_layout |
| twitter:image | https://opengraph.githubassets.com/595527df11fd3e2072435f5ffcf77a5f58e89a8461271892cc0bb021d6a438a0/python/cpython/issues/139067 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/595527df11fd3e2072435f5ffcf77a5f58e89a8461271892cc0bb021d6a438a0/python/cpython/issues/139067 |
| og:image:alt | Documentation The documentation for argparse's append action when a default value is provided is unclear Currently the docs state: 'append' - This stores a list, and appends each argument value to ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | moshekaplan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width