News for hackers. Stuff that matters.
Re:Show HN: Koda, a typesafe functional toolkit for Python by keithasaurus on Monday February 07, 2022 @03:41PM (#30250756)
> There is no procedural concepts like variable assignment allowed in a python lambda.

Just a small note that the walrus operator gives you some wiggle room here:

  add_5_to_square_if_greater_than_10 = lambda x: squared + 5 if (squared := x * x) > 10 else x
  assert add_5_to_square_if_greater_than_10(2) == 2
  assert add_5_to_square_if_greater_than_10(5) == 30
Re:Show HN: Koda, a typesafe functional toolkit for Python by deltaonefour on Monday February 07, 2022 @04:08PM (#30251192)
yeah my bad. Not fully up to date with all the newer python 3 tricks. That walrus operator is a trap though imo.