
On Thu, Oct 24, 2019 at 9:12 AM Christopher Barker <pythonchb@gmail.com> wrote:
On Wed, Oct 23, 2019 at 1:41 PM Steven D'Aprano <steve@pearwood.info> wrote:
Virtually overnight, the Python community got used to the opposite change, with f-strings: something that looks like a string is actually code containing identifiers and even arbitrary expressions:
f"Your score is {score}"
well, it's technically code, yes, but it's functionally still a string -- it looks like a string, and it evaluates to a string. I don't think that's analogous.
An f-string is syntactic sugar for something (very approximately) like: "".join("Your score is ", format(score)) Is that a string? It results in a string. Is a list comprehension a list? It results in a list. Programmer intention and concrete implementation are completely different. Having syntactic sugar for the creation of a list of strings is quite different from having a string which you then split, even if the implementation is a string being split.
so I don't believe that this will be anywhere near the cognitive load that you state
Again, this is all gut feeling, but we're talking about adding something new here -- a tiny bit better, and maybe worse for some, is NOT enough to add a new feature.
I can't keep track of who's who, but quite amazing to me that this is getting traction, and on the next thread over (some) people seem convinced that
dict1 + dict2 would be incredibly confusing!
oh well, language design is hard.
Yeah, well... welcome to the insanity that we call "python-ideas" :) ChrisA