Title: docs(skills): add enum nesting order guideline to usethis-python-enum skill by Copilot · Pull Request #1885 · usethis-python/usethis-python · GitHub
Open Graph Title: docs(skills): add enum nesting order guideline to usethis-python-enum skill by Copilot · Pull Request #1885 · usethis-python/usethis-python
X Title: docs(skills): add enum nesting order guideline to usethis-python-enum skill by Copilot · Pull Request #1885 · usethis-python/usethis-python
Description: Enum dispatch at the outermost nesting level leads to duplicated guard conditions across enum arms — a pattern that should instead be inverted: shared guards outer, enum dispatch inner. Changes usethis-python-enum SKILL.md (v1.0 → v1.1): adds a new "Nesting order: outer guards, inner enum dispatch" section encoding the principle with a diagnostic signal and a before/after code example: # ❌ Inverted: guard duplicated inside each enum arm if backend is BackendEnum.uv: if _some_guard(): _do_uv_thing() elif backend is BackendEnum.poetry: if _some_guard(): _do_poetry_thing() # ✅ Correct: shared guard outer, enum dispatch inner if backend in (BackendEnum.uv, BackendEnum.poetry): if _some_guard(): if backend is BackendEnum.uv: _do_uv_thing() elif backend is BackendEnum.poetry: _do_poetry_thing() else: assert_never(backend)
Open Graph Description: Enum dispatch at the outermost nesting level leads to duplicated guard conditions across enum arms — a pattern that should instead be inverted: shared guards outer, enum dispatch inner. Changes us...
X Description: Enum dispatch at the outermost nesting level leads to duplicated guard conditions across enum arms — a pattern that should instead be inverted: shared guards outer, enum dispatch inner. Changes us...
Opengraph URL: https://github.com/usethis-python/usethis-python/pull/1885
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:1f5a7316-75c9-1510-6ea0-ff1da1e2919b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EBDE:17FA4:EB6C43:1454017:6A4DD185 |
| html-safe-nonce | f8a6439ac1b683b0f196e9ef777b3e8b1403e49d501e28ed3cd7c26bed31a941 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkRFOjE3RkE0OkVCNkM0MzoxNDU0MDE3OjZBNEREMTg1IiwidmlzaXRvcl9pZCI6IjUxNDQxNzU5NTgxOTQ3NzAzMTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d7e2cdd35d5aac28c43839f0f16d70aba3be0628efb6a6ab7bf48ba803b72720 |
| hovercard-subject-tag | pull_request:3500656837 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/usethis-python/usethis-python/pull/1885/files |
| twitter:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| og:image:alt | Enum dispatch at the outermost nesting level leads to duplicated guard conditions across enum arms — a pattern that should instead be inverted: shared guards outer, enum dispatch inner. Changes us... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git |
| octolytics-dimension-user_id | 216362695 |
| octolytics-dimension-user_login | usethis-python |
| octolytics-dimension-repository_id | 842189705 |
| octolytics-dimension-repository_nwo | usethis-python/usethis-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 842189705 |
| octolytics-dimension-repository_network_root_nwo | usethis-python/usethis-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width