News for hackers. Stuff that matters.
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.

Re:Examples of Incorrect Abstractions in Other Languages by Izkata on Wednesday May 20, 2020 @05:22PM (#23251952)
You forgot:

  "%s%s" % (a, b)
(Still works at least as of python 3.6)