ikamensh / flynt

A tool to automatically convert old string literal formatting to f-strings
MIT License
689 stars 33 forks source link

Support for print statement without parentheses in python2 style #175

Closed horoyoii closed 1 year ago

horoyoii commented 1 year ago

Thanks for providing such a useful tool.

Conversion to fstring is not performed for the print statement without parentheses in python2 style. The following sentence was not converted because the print statement did not use parentheses even though % ​​formatting was used.

print '%s get doc %s'%(datetime.now(), fpath)

Is support available for these types of cases?

lhasadad commented 1 year ago

This would not make any sense. There is no f"" string in python2. I would not expect any support for that.

eli-schwartz commented 1 year ago

Seems like the logical thing to do here is to first convert the code into python3-compatible code using modernize, and then run python3-based refactoring tools.

ikamensh commented 1 year ago

The complexity for flynt source code by supporting python2 which is deprecated now is not worth it.