Hacker News new | ask | show | jobs
by nwatson 1913 days ago
It kind of works in Python 3.9 and perhaps earlier, unfortunately need extra parentheses ...

  >>> print((v1 := 2 * 3) * (v2 := 7))
  42
  >>> print(v1)
  6
  >>> print(v2)
  7
edit: formatting