
Feb. 6, 2021
8:46 a.m.
05.02.21 09:51, Paul Sokolovsky пише:
a0 = 0 b0 = 10 while ((a1, b1) := phi([a0, a2], [b0, b2]))[0] < 5: a2 = a1 + 1 b2 = b1 + 1
Such code quickly becomes unreadable. Especially if in real code function has additional arguments and names are longer that 2-3 characters. The following code is not much larger but more clear and extensible: a0 = 0 b0 = 10 while True: a1, b1 := phi([a0, a2], [b0, b2])) if b1 >= 5: break a2 = a1 + 1 b2 = b1 + 1