frnhr frnhr - 8 days ago 6
Python Question

Why no from __future__ import formatted_string_literals in Python <3.6?

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

Answer

from __future__ imports are used to introduce incompatible changes, f-strings are a new feature and not a breaking change.

Comments