Title: Support Union of `Enum` and/or `Literal` in annotations for `with_annotated` decorator · Issue #1686 · python-cmd2/cmd2 · GitHub
Open Graph Title: Support Union of `Enum` and/or `Literal` in annotations for `with_annotated` decorator · Issue #1686 · python-cmd2/cmd2
X Title: Support Union of `Enum` and/or `Literal` in annotations for `with_annotated` decorator · Issue #1686 · python-cmd2/cmd2
Description: Feature Request Support Union of Enum and/or Literal in annotations for with_annotated decorator. Especially unions for different Enums seams to be desirable to reduce code duplication. Code Example class App(Cmd): @with_annotated def do...
Open Graph Description: Feature Request Support Union of Enum and/or Literal in annotations for with_annotated decorator. Especially unions for different Enums seams to be desirable to reduce code duplication. Code Exampl...
X Description: Feature Request Support Union of Enum and/or Literal in annotations for with_annotated decorator. Especially unions for different Enums seams to be desirable to reduce code duplication. Code Exampl...
Opengraph URL: https://github.com/python-cmd2/cmd2/issues/1686
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support Union of `Enum` and/or `Literal` in annotations for `with_annotated` decorator","articleBody":"# Feature Request\n\nSupport Union of `Enum` and/or `Literal` in annotations for `with_annotated` decorator. Especially unions for different Enums seams to be desirable to reduce code duplication.\n\n## Code Example\n\n```python\nclass App(Cmd):\n\n @with_annotated\n def do_something_with_enums(a: EnumA, b: EnumB, combine: EnumA | EnumB) -\u003e None:\n ...\n\n```","author":{"url":"https://github.com/neoniobium","@type":"Person","name":"neoniobium"},"datePublished":"2026-06-10T14:15:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/1686/cmd2/issues/1686"}
| 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:e8b09194-5635-8da7-5b56-ddc0606d51ae |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D016:230F9A:1B41E8:24F86B:6A51D4E1 |
| html-safe-nonce | efeb5b95682d2b04b814cf37999efcece1d9386468b8f570be34f359e473fbc4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDE2OjIzMEY5QToxQjQxRTg6MjRGODZCOjZBNTFENEUxIiwidmlzaXRvcl9pZCI6IjYzNjAyNDYwMTc5MzY0Nzg0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e2d1b4b622fabc93ce2b8f6e36961c403420f63236f0ece4d52fcdb788033ac9 |
| hovercard-subject-tag | issue:4632076448 |
| 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/1686/issue_layout |
| twitter:image | https://opengraph.githubassets.com/06338c9efec0380540e310f1fcce16345428d9ed9f0d5dc310db8f702c871648/python-cmd2/cmd2/issues/1686 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/06338c9efec0380540e310f1fcce16345428d9ed9f0d5dc310db8f702c871648/python-cmd2/cmd2/issues/1686 |
| og:image:alt | Feature Request Support Union of Enum and/or Literal in annotations for with_annotated decorator. Especially unions for different Enums seams to be desirable to reduce code duplication. Code Exampl... |
| 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 | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width