Title: argparse.ArgumentParser.add_action should return Action, not None · Issue #1878 · python/typeshed · GitHub
Open Graph Title: argparse.ArgumentParser.add_action should return Action, not None · Issue #1878 · python/typeshed
X Title: argparse.ArgumentParser.add_action should return Action, not None · Issue #1878 · python/typeshed
Description: add_action returns the Action object added, but argparse.pyi has it returning None. This causes mypy to complain about code like: parser.add_argument("--proto").completer=ChoicesCompleter(('http', 'https', 'ssh', 'rsync', 'wss')) as sugg...
Open Graph Description: add_action returns the Action object added, but argparse.pyi has it returning None. This causes mypy to complain about code like: parser.add_argument("--proto").completer=ChoicesCompleter(('http', ...
X Description: add_action returns the Action object added, but argparse.pyi has it returning None. This causes mypy to complain about code like: parser.add_argument("--proto").completer=ChoicesCompleter...
Opengraph URL: https://github.com/python/typeshed/issues/1878
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"argparse.ArgumentParser.add_action should return Action, not None","articleBody":"add_action [returns](https://github.com/python/cpython/blob/3.6/Lib/argparse.py#L1348) the Action object added, but argparse.pyi has it [returning None](https://github.com/python/typeshed/blob/master/stdlib/2and3/argparse.pyi#L79).\r\n\r\nThis causes mypy to complain about code like:\r\n\r\n```\r\nparser.add_argument(\"--proto\").completer=ChoicesCompleter(('http', 'https', 'ssh', 'rsync', 'wss'))\r\n```\r\nas [suggested by the `argcomplete` docs](https://pypi.python.org/pypi/argcomplete#specifying-completers):\r\n\r\n```\r\nerror: \"add_argument\" of \"ArgumentParser\" does not return a value\r\n```","author":{"url":"https://github.com/EvanKrall","@type":"Person","name":"EvanKrall"},"datePublished":"2018-02-14T02:36:52Z","url":"https://github.com/python/typeshed/issues/1878"}
| 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:6a3ccd3c-b448-b78b-5a34-ae89b04f12c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9848:1A2F85:BC7577:FD21BE:6B004D60 |
| html-safe-nonce | ca45d5a03869e36eb415eb6fe008dd94894b8f71f50d0b0801397be3d85ae22c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODQ4OjFBMkY4NTpCQzc1Nzc6RkQyMUJFOjZCMDA0RDYwIiwidmlzaXRvcl9pZCI6IjIzNjAzODU1OTUyNjk3Mjk2MzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7edc00e3177913abeb4354204ae55f091ed7adb06d75c9746bb7c8cb92a0e59f |
| hovercard-subject-tag | issue:296957099 |
| 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/typeshed/1878/issue_layout |
| twitter:image | https://opengraph.githubassets.com/069d93267beb7a43d01f42e0eada0097ada26dd409319a82e49d45ed0697eaef/python/typeshed/issues/1878 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/069d93267beb7a43d01f42e0eada0097ada26dd409319a82e49d45ed0697eaef/python/typeshed/issues/1878 |
| og:image:alt | add_action returns the Action object added, but argparse.pyi has it returning None. This causes mypy to complain about code like: parser.add_argument("--proto").completer=ChoicesCompleter(('http', ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | EvanKrall |
| hostname | github.com |
| expected-hostname | github.com |
| None | f9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| 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 | b27c5dde30676028abd5c5fc53ce5c9b625f8281 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width