News for hackers. Stuff that matters.
Re:Python 3.11 vs 3.10 performance by dragonwriter on Wednesday July 06, 2022 @09:33PM (#32008981)
In the example from the end of the earlier post:

   y
   for x in xs
   if (y:=x.ComputeSomething()).IsFoo and y.IsBar
Re:Python 3.11 vs 3.10 performance by int_19h on Wednesday July 06, 2022 @11:20PM (#32009574)
I suppose that works, although readability is not great, to put it mildly.
Re:Python 3.11 vs 3.10 performance by texaslonghorn5 on Wednesday July 06, 2022 @11:21PM (#32009580)
Much better would be

[(y:=x.ComputeSomething()) for x in xs if y.IsFoo and y.IsBar]

Re:Python 3.11 vs 3.10 performance by int_19h on Thursday July 07, 2022 @03:01AM (#32010755)
That doesn't work, because that first subexpression is evaluated last, after "if".