News for hackers. Stuff that matters.
Re:Python 3.12 by bloopernova on Monday October 02, 2023 @09:29AM (#37737811)
oh cool, multi-line f-strings. With inline comments!

    f"This is the playlist: {", ".join([
        'Take me back to Eden',  # My, my, those eyes like fire
        'Alkaline',              # Not acid nor alkaline
        'Ascensionism'           # Take to the broken skies at last
    ])}"
Re:Python 3.12 by pcerdam on Monday October 02, 2023 @09:43AM (#37737996)
Some great choices in that playlist ;)
Re:Python 3.12 by adrian17 on Monday October 02, 2023 @09:51AM (#37738092)
This probably isn't a good motivating example - my first thought was that this is an overcomplicated way to write

    "This is the playlist: " + ", ".join([
        'Take me back to Eden',  # My, my, those eyes like fire
        'Alkaline',              # Not acid nor alkaline
        'Ascensionism'           # Take to the broken skies at last
    ])
Which is easier to read and exactly as long.

(In fact, without 3.12-compatible syntax highlighting, my first intuition upon reading the first line would be to suspect the code of having a typo.)

Re:Python 3.12 by js2 on Monday October 02, 2023 @09:56AM (#37738178)
I don't find that example particularly compelling. To me it's more legible using regular strings:

  "This is the playlist: " + ", ".join([
      "Take me back to Eden",  # My, my, those eyes like fire
      "Alkaline",              # Not acid nor alkaline
      "Ascensionism",          # Take to the broken skies at last
  ])"
edit: jinx