Re:Examples of Incorrect Abstractions in Other Languages
by hawski on Wednesday May 20, 2020 @08:59AM
(#23246317)
Let's concatenate strings.
a + b
f"{a}{b}"
"".join([a, b])
"{}{}".format(a, b)
If a == b, then you can also, which itself is a bit ridiculous:
a * 2
Is mentioning StringIO considered cheating?
I would feel the Zen if Python would have a separate concatenation operator, it could be even the same for strings and lists. Lack of the operator in popular languages is my pet peeve.
I would feel the Zen if Python would have a separate concatenation operator, it could be even the same for strings and lists. Lack of the operator in popular languages is my pet peeve.