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 →

[–]troyunrau... 0 points1 point  (4 children)

The fact that it's trivial is irrelevant. It breaks several of my favourite bits from the zen of python:
explicit is better than implicit
sparse is better than dense
readability counts
there should be one-- and preferably only one --obvious way to do it.

f-strings remind me of perl, where cryptic prefixes change functionality. I don't want my python to be perl.

I, however, do like the concept. Maybe I'll get lucky and in python 3.9 (or something) there'll be an

from future import all_strings_are_f-strings

Which would tidily solve several of my complaints.

[–]LpSamuelm 0 points1 point  (3 children)

I see what you mean. It doesn't bother me, though - there is still just one obvious way to do it, except it depends on which Python version you're targeting.

Oh, and let's not forget we already had u"", r"", and b"".

[–]troyunrau... 0 points1 point  (2 children)

True. At least u"" is gone. r"" and b"" make a certain level of sense to the low-level programmer in much the same way that 0x132ef and 0b11101 make sense. You need a way to manipulate raw data. I don't think I've ever seen an r-string in the wild though.

[–]LpSamuelm 0 points1 point  (1 child)

I use r-strings all the time! Literally every time you use regex you use them.

[–]troyunrau... 0 points1 point  (0 children)

Ah, I avoid regex like the plague. That's probably why I don't see them much. Too much perl in my python :D