Title: `with_annotated` and `with_argparse` decorators do not work with `staticmethod` · Issue #1683 · python-cmd2/cmd2 · GitHub
Open Graph Title: `with_annotated` and `with_argparse` decorators do not work with `staticmethod` · Issue #1683 · python-cmd2/cmd2
X Title: `with_annotated` and `with_argparse` decorators do not work with `staticmethod` · Issue #1683 · python-cmd2/cmd2
Description: Problem with_annotated and with_argparser decorators do not work with the builtin staticmethod decorator. How to reproduce class Failed(Cmd): @with_annotated @staticmethod def do_a(...) -> None: ... @with_argparser @staticmethod def do_b...
Open Graph Description: Problem with_annotated and with_argparser decorators do not work with the builtin staticmethod decorator. How to reproduce class Failed(Cmd): @with_annotated @staticmethod def do_a(...) -> None: .....
X Description: Problem with_annotated and with_argparser decorators do not work with the builtin staticmethod decorator. How to reproduce class Failed(Cmd): @with_annotated @staticmethod def do_a(...) -> None:...
Opengraph URL: https://github.com/python-cmd2/cmd2/issues/1683
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`with_annotated` and `with_argparse` decorators do not work with `staticmethod`","articleBody":"# Problem\n\n`with_annotated` and `with_argparser` decorators do not work with the builtin `staticmethod` decorator.\n\n## How to reproduce\n\n```python\nclass Failed(Cmd):\n\n @with_annotated\n @staticmethod\n def do_a(...) -\u003e None:\n ...\n\n @with_argparser\n @staticmethod\n def do_b(...) -\u003e None:\n ...\n```\n\n## Expected behavior\n\nBoth decorated methods can be declared without a self argument by using the `staticmethod` decorator for at least one order of decorators.\n\n## Actual behavior\n\nCalling booth methods fail with different errors.","author":{"url":"https://github.com/neoniobium","@type":"Person","name":"neoniobium"},"datePublished":"2026-06-10T13:50:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/1683/cmd2/issues/1683"}
| 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:ac7fa85d-aff7-4740-5a48-1e66a196ef44 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8FB8:2B01A0:1C7361:29B033:6A4DFE95 |
| html-safe-nonce | 8514fc04d84284f1d88d52937187414f19559689a4b0618f737f4138784c221c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkI4OjJCMDFBMDoxQzczNjE6MjlCMDMzOjZBNERGRTk1IiwidmlzaXRvcl9pZCI6IjM3MDI3NTMxMjgyOTU5NTI4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6d105ed35e27289ca0a3ceafeb9df0c13100fd672aeb8d9e33da389850c247b1 |
| hovercard-subject-tag | issue:4631861030 |
| 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-cmd2/cmd2/1683/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d304f148ccd2e122c1becd27b8dbcb227ee04b737a24e92f260d680f21473302/python-cmd2/cmd2/issues/1683 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d304f148ccd2e122c1becd27b8dbcb227ee04b737a24e92f260d680f21473302/python-cmd2/cmd2/issues/1683 |
| og:image:alt | Problem with_annotated and with_argparser decorators do not work with the builtin staticmethod decorator. How to reproduce class Failed(Cmd): @with_annotated @staticmethod def do_a(...) -> None: ..... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | neoniobium |
| hostname | github.com |
| expected-hostname | github.com |
| None | df0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-cmd2/cmd2 git https://github.com/python-cmd2/cmd2.git |
| octolytics-dimension-user_id | 17161025 |
| octolytics-dimension-user_login | python-cmd2 |
| octolytics-dimension-repository_id | 51442999 |
| octolytics-dimension-repository_nwo | python-cmd2/cmd2 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 51442999 |
| octolytics-dimension-repository_network_root_nwo | python-cmd2/cmd2 |
| 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 | 52bde38e24398476f8eb1e0760c81346c6a00812 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width