Title: Modernise code in `Tools/clinic/` · Issue #104683 · python/cpython · GitHub
Open Graph Title: Modernise code in `Tools/clinic/` · Issue #104683 · python/cpython
X Title: Modernise code in `Tools/clinic/` · Issue #104683 · python/cpython
Description: Feature or enhancement Modernise some Python anachronisms in Tools/clinic/, to make the code more readable and maintainable. Some things that can be easily done: Use dict instead of OrderedDict (#104647) Simplify code like this by using ...
Open Graph Description: Feature or enhancement Modernise some Python anachronisms in Tools/clinic/, to make the code more readable and maintainable. Some things that can be easily done: Use dict instead of OrderedDict (#1...
X Description: Feature or enhancement Modernise some Python anachronisms in Tools/clinic/, to make the code more readable and maintainable. Some things that can be easily done: Use dict instead of OrderedDict (#1...
Opengraph URL: https://github.com/python/cpython/issues/104683
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Modernise code in `Tools/clinic/`","articleBody":"# Feature or enhancement\r\n\r\nModernise some Python anachronisms in `Tools/clinic/`, to make the code more readable and maintainable. Some things that can be easily done:\r\n\r\n- [x] Use `dict` instead of `OrderedDict` (#104647)\r\n- [x] Simplify code like this by using the `str.removesuffix` and `str.removeprefix` methods, both new in Python 3.9:\r\n https://github.com/python/cpython/blob/06eeee97e36aa6bb3d21d7cbc288763ae3a7b21e/Tools/clinic/clinic.py#L2572-L2575\r\n\r\n (#104685)\r\n- [x] [Pyupgrade](https://github.com/asottile/pyupgrade) (run using the `--py310-plus` setting) also finds various things that can be modernised (#104684)\r\n\r\n- [ ] Refactor CLanguage.output_templates (see https://github.com/python/cpython/issues/104683#issuecomment-1633266536)\r\n- [ ] Put templating in a separate .py file, kind of like Tools/clinic/cpp.py\r\n- [x] #107468\r\n- [x] #107467\r\n\r\nCc. @erlend-aasland\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-104647\r\n* gh-104684\r\n* gh-104685\r\n* gh-104696\r\n* gh-104729\r\n* gh-104730\r\n* gh-106362\r\n* gh-106443\r\n* gh-106444\r\n* gh-106445\r\n* gh-106476\r\n* gh-106477\r\n* gh-106478\r\n* gh-106652\r\n* gh-106698\r\n* gh-106721\r\n* gh-106837\r\n* gh-107289\r\n* gh-107340\r\n* gh-107435\r\n* gh-107439\r\n* gh-107541\n* gh-107543\n* gh-107550\n* gh-107551\n* gh-107556\n* gh-107623\n* gh-107635\n* gh-107638\n* gh-107667\n* gh-107770\n* gh-107771\n* gh-107790\n* gh-107840\n* gh-107964\n* gh-108092\n* gh-108552\n\u003c!-- /gh-linked-prs --\u003e","author":{"url":"https://github.com/AlexWaygood","@type":"Person","name":"AlexWaygood"},"datePublished":"2023-05-20T10:22:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/104683/cpython/issues/104683"}
| 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:b2fbf597-29e9-7fe0-4474-e20477e0b49c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9726:2DB2A9:9A702B:D4BDB0:6969ED3B |
| html-safe-nonce | e8543b1ef2d46d5892db39e6eb78602a74245cd00990bb60c24dcf4efaeecd79 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzI2OjJEQjJBOTo5QTcwMkI6RDRCREIwOjY5NjlFRDNCIiwidmlzaXRvcl9pZCI6IjYyNzY3MzM4NzYwODAwNzgxMzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a40d148207a59429c937c638c73d780494d82430ba18acfd910b17837d60f962 |
| hovercard-subject-tag | issue:1718127348 |
| 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/104683/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3dc558a20a6eb6857df4b9e12f3c1ac088617c6916714348104f190299ff5beb/python/cpython/issues/104683 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3dc558a20a6eb6857df4b9e12f3c1ac088617c6916714348104f190299ff5beb/python/cpython/issues/104683 |
| og:image:alt | Feature or enhancement Modernise some Python anachronisms in Tools/clinic/, to make the code more readable and maintainable. Some things that can be easily done: Use dict instead of OrderedDict (#1... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AlexWaygood |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| 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 | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width