linusgroh’s avatarlinusgroh’s Twitter Archive—№ 2,899

  1. Found a wonderful (ab)use case of the walrus operator in Python list comprehensions 🐍 >>> total = 0 >>> [total := total + i for i in range(10)] [0, 1, 3, 6, 10, 15, 21, 28, 36, 45] >>>