2 ms·
> while s := network_service.read(): > process(s) Watch out with this one though. In this case it's good, but if you receive numbers from such fun
by kolinko 7y ago
> while s := network_service.read():
> process(s)
Watch out with this one though. In this case it's good, but if you receive numbers from such function, it will break loop not just on None but on 0 as well. Easy to forget.
In many cases you'll need to do:
while (s:= ....) is not None: