We had from __future__ import print_function in 2.7, so could we have from __future__ import formatted_string_literals in, say, 3.4 and 3.5 (maybe even 2.7)?
Is there some policy that prohibits this, some technical reason, or just nobody got around tuit yet?
Ref: PEP 498: Formatted string literals
Bringing f-strings to Python less than 3.6 is now covered at https://stackoverflow.com/a/46182112/8508004 . It is done via future-fstrings and simply requires a special line at the top of your code.
(I wanted to comment above but couldn't yet due to reputation restrictions for that.)
from __future__ imports are used to introduce incompatible changes, f-strings are a new feature and not a breaking change.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With