A simple rewriting of some of the code to be more modern. Replacing %-formatting and string concatenation with f-strings and replacing while 1 with while True.
changed the title [-]Replacing %-formatting and string concatenation with f-strings[/-][+]Replacing %-formatting and string concatenation with f-strings in platform module[/+]on Jul 9, 2022
We don't make a habit of re-writing working code just for the sake of re-writing it. %-formatting works, and is usually faster than "more modern" formatting, so that would be code churn that makes the code worse rather than better.
Since this is just a cosmetic change that will probably hurt performance, I'm going to close this. If you benchmark the changes and find that they are significantly faster, feel free to reopen.
Activity
stevendaprano commented on Jul 10, 2022
We don't make a habit of re-writing working code just for the sake of re-writing it. %-formatting works, and is usually faster than "more modern" formatting, so that would be code churn that makes the code worse rather than better.
Since this is just a cosmetic change that will probably hurt performance, I'm going to close this. If you benchmark the changes and find that they are significantly faster, feel free to reopen.
gh-94713 - Replacing while 1 with while True (#94714)