• horni3000@feddit.de
    link
    fedilink
    arrow-up
    0
    ·
    2 years ago

    You can reduce this readable code into one line of confusing python list comprehension that runs 100x slower!

    • 0xff@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

      What’s wrong with list comprehensions? Do I just have Stockholm Syndrome at this point?

      I would skip the square brackets and just use a generator expression: sum(3*n for n in range(5)).