News for hackers. Stuff that matters.
Re:Pattern matching accepted for Python by matt_trentini on Tuesday February 09, 2021 @06:54PM (#26084168)
Take a look at flynt, a tool that can convert older string formatting code to the newer fstring style. I've found it very helpful!

https://github.com/ikamensh/flynt

Re:Pattern matching accepted for Python by aidos on Tuesday February 09, 2021 @07:02PM (#26084234)
Can confirm. I replaced 1.5k instances in our code base in seconds using flynt and it knew the ones that couldn't be swapped out directly. Really great tool. You only ever need it once in your life, but that one time it's amazing.
Re:Pattern matching accepted for Python by andrewem on Tuesday February 09, 2021 @07:51PM (#26084558)
Having not written Python in a long time until recently, I discovered fstrings. Are they the best choice for (nearly all) string formatting at least in new code? They seem to work pretty similarly to eg Ruby’s string interpolation.