Closed Martmists-GH closed 6 years ago
Maybe an shortcut function could do it, however then how would I substitute it for an f string if python >= 3.6?
import sys
def format_str(formatstr, *args):
if sys.version_info < (3, 6):
if args:
return str.format(formatstr, args)
else:
return str.format(formatstr)
else:
# go to f string.
return f"{formatstr}"
perhaps the only way is to figure out how to similate the f strings?
what the hell did you smoke
It's just gonna be "{}".format(...)
instead of f"{}"
That code you provided will fail either way and won't even work...
Ah I see, I sorta forgot because of fstrings.
We're using a lot of f-strings, they should be reworked to str.format to support lower versions of python.