News for hackers. Stuff that matters.
Re:Peter Norvig's “pytudes” for Advent of Code 2020 by tuvistavie on Friday January 08, 2021 @08:57AM (#25684737)
I am not sure I would advocate for this but, from Python 3.8, this is an instance where assignment expressions could allow the first code without duplication.

    first(x * y
          for x in nums
          if (y := 2020 - x) in nums and x != y)
Re:Peter Norvig's “pytudes” for Advent of Code 2020 by norvig on Friday January 08, 2021 @02:07PM (#25688687)
I agree, tuvistavie! But my default machine has 3.7 installed, and I didn't want to get too far ahead of readers. Sometime next year I'll go to 3.8, and look forward to using ":="