14 May
2018
14 May
'18
11:26 a.m.
On 12/05/18 01:41, Juancarlo AƱez wrote:
while (cmd := get_command()).token != CMD_QUIT: cmd.do_something()
while get_command() as cmd: if cmd.token == CMD_QUIT: break cmd.do_something()
This would be exactly one of the patterns Python currently forces on me that I don't like. This "while expr as name" form is not a win in my book. -- Rhodri James *-* Kynesim Ltd