Title: Argument Clinic: split out global stateless helpers and constants from clinic.py · Issue #113317 · python/cpython · GitHub
Open Graph Title: Argument Clinic: split out global stateless helpers and constants from clinic.py · Issue #113317 · python/cpython
X Title: Argument Clinic: split out global stateless helpers and constants from clinic.py · Issue #113317 · python/cpython
Description: Feature or enhancement clinic.py has a lot of globals in various forms. Getting rid of the globals will make it possible to split out clinic.py in multiple files (#113299). Combined, this will impact readability and maintainability of Ar...
Open Graph Description: Feature or enhancement clinic.py has a lot of globals in various forms. Getting rid of the globals will make it possible to split out clinic.py in multiple files (#113299). Combined, this will impa...
X Description: Feature or enhancement clinic.py has a lot of globals in various forms. Getting rid of the globals will make it possible to split out clinic.py in multiple files (#113299). Combined, this will impa...
Opengraph URL: https://github.com/python/cpython/issues/113317
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Argument Clinic: split out global stateless helpers and constants from clinic.py","articleBody":"# Feature or enhancement\n\n`clinic.py` has a lot of globals in various forms. Getting rid of the globals will make it possible to split out `clinic.py` in multiple files (https://github.com/python/cpython/issues/113299). Combined, this will impact readability and maintainability of Argument Clinic in a positive way.\n\nMost globals can be easily dealt with. We can structure them into two groups:\n- global constants that are not mutated\n- stateless helper functions and classes\n\nIt can make sense split out some of these in separate files (for example a libclinic package, as suggested in #113309). For some globals, it makes more sense to embed them into one of the existing classes (for example the global `version` variable clearly belongs in `DSLParser`).\n\nSuggesting to start with the following:\n\n- move stateless text accumulator helpers into a `Tools/clinic/libclinic/accumulators.py` file\n- move stateless text formatting helpers into a `Tools/clinic/libclinic/formatters.py` file\n- move `version` into `DSLParser` and version helper into a `Tools/clinic/libclinic/version.py` file\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-113402\n* gh-113413\n* gh-113414\n* gh-113438\n* gh-113525\n* gh-113986\n* gh-114066\n* gh-114319\n* gh-114324\n* gh-114330\n* gh-114752\n* gh-115369\n* gh-115370\n* gh-115371\n* gh-115510\n* gh-115513\n* gh-115517\n* gh-115518\n* gh-115520\n* gh-115522\n* gh-116770\n* gh-116807\n* gh-116819\n* gh-116821\n* gh-116836\n* gh-116853\n* gh-117315\n* gh-117451\n* gh-117455\n* gh-117513\n* gh-117533\n* gh-117624\n* gh-117626\n* gh-117707\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/erlend-aasland","@type":"Person","name":"erlend-aasland"},"datePublished":"2023-12-20T12:45:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/113317/cpython/issues/113317"}
| 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:fd755cad-b742-810e-0747-ca84405bd834 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE7C:1940BA:1022049:1588EDF:69699267 |
| html-safe-nonce | e33441ecf9890e4ec99458fe0fadccc52ef84c1678c22f54ee138bd097f71c36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTdDOjE5NDBCQToxMDIyMDQ5OjE1ODhFREY6Njk2OTkyNjciLCJ2aXNpdG9yX2lkIjoiMTI4MTcyNTg4MzM2NTI5ODc5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 48e00f2ce8217ba8e52380ae68684b748226339061be9aae63dbcc18270403b1 |
| hovercard-subject-tag | issue:2050482755 |
| 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/113317/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d3ae4f37c32925c3738ba4e6ace826dcb4f72cc8daf195a4b2c246a7d3c7be65/python/cpython/issues/113317 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d3ae4f37c32925c3738ba4e6ace826dcb4f72cc8daf195a4b2c246a7d3c7be65/python/cpython/issues/113317 |
| og:image:alt | Feature or enhancement clinic.py has a lot of globals in various forms. Getting rid of the globals will make it possible to split out clinic.py in multiple files (#113299). Combined, this will impa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | erlend-aasland |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751 |
| 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 | af80af7cc9e3de9c336f18b208a600950a3c187c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width