A simple question about Python syntax. I want to assign a value from a function to a variable during the condition for a while loop. When the value returned from the functio
Python 3.8 pep-0572 now address this case using the new notation :=. Have a look :)
:=
For example:
while chunk := file.read(8192): process(chunk)