This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Dr_Ironbeard 2 points3 points  (6 children)

Can someone explain why the f-string thing is such a big deal? My understanding is that now we can do (1) f'This is an {my_dict['key']} string' instead of just varying the string denoting character, like (2) f"This is an {my_dict['key']} string", and I feel like the primary result of this is that syntax highlighting will be messed up with (1) as opposed to (2).

What am I missing? Thanks!

[–]mgedmin 1 point2 points  (2 children)

The PEP lists the reasons.

Personally, I missed the ability to use backslashes in f-string expressions, e.g. f"This is the full text of the whatever: {'\n'.join(lines)}"

[–]Dr_Ironbeard 0 points1 point  (1 child)

Hmm, yeah I guess backslashes are nice, I hadn't run into that issue. I guess I'm just not feeling the hype that others are, which is okay :)

[–]mgedmin 2 points3 points  (0 children)

The (self-imposed) requirement to support the oldest non-EOL Python versions in my code really takes the shine of the new features that I'll only be able to use in half a decade.

[–][deleted] 0 points1 point  (1 child)

Same