# 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: - [x] Use `dict` instead of `OrderedDict` (#104647) - [x] Simplify code like this by using the `str.removesuffix` and `str.removeprefix` methods, both new in Python 3.9: https://github.com/python/cpython/blob/06eeee97e36aa6bb3d21d7cbc288763ae3a7b21e/Tools/clinic/clinic.py#L2572-L2575 (#104685) - [x] [Pyupgrade](https://github.com/asottile/pyupgrade) (run using the `--py310-plus` setting) also finds various things that can be modernised (#104684) - [ ] Refactor CLanguage.output_templates (see https://github.com/python/cpython/issues/104683#issuecomment-1633266536) - [ ] Put templating in a separate .py file, kind of like Tools/clinic/cpp.py - [x] #107468 - [x] #107467 Cc. @erlend-aasland <!-- gh-linked-prs --> ### Linked PRs * gh-104647 * gh-104684 * gh-104685 * gh-104696 * gh-104729 * gh-104730 * gh-106362 * gh-106443 * gh-106444 * gh-106445 * gh-106476 * gh-106477 * gh-106478 * gh-106652 * gh-106698 * gh-106721 * gh-106837 * gh-107289 * gh-107340 * gh-107435 * gh-107439 * gh-107541 * gh-107543 * gh-107550 * gh-107551 * gh-107556 * gh-107623 * gh-107635 * gh-107638 * gh-107667 * gh-107770 * gh-107771 * gh-107790 * gh-107840 * gh-107964 * gh-108092 * gh-108552 <!-- /gh-linked-prs -->