microscope-cockpit / cockpit

Cockpit is a microscope graphical user interface. It is a flexible and easy to extend platform aimed at life scientists using bespoke microscopes.
https://microscope-cockpit.org
GNU General Public License v3.0
35 stars 26 forks source link

Convert old string % mapping to f strings #857

Closed iandobbie closed 1 year ago

iandobbie commented 1 year ago

Just found flynt, a tool that will walk the code tree and convert all the old style % string mapping to newer f strings.

I would say we should probably run this or a similar tool over the code but wait until we are at python version 3.6+ as this is when f strings were introduced.

carandraug commented 1 year ago

Is this for any particular reason other than preference for f strings?

iandobbie commented 1 year ago

No, in fact I still struggle to write f strings and usually just use the old style. I mention it with the idea that the old style might be deprecated and then removed, but I guess it is easy to wait until this is threatened before we update, especially if there is a tool which will do it all in one fell swoop.

carandraug commented 1 year ago

For reference, I'll just add here my own preference for old style format strings over f-strings as well. Let's not do it unless we have to.