import asyncio
from asyncio import StreamReader
async def echo(reader: StreamReader):
try:
while data := await reader.readline():
pass
Question> why we have to data := await
here instead of data = await
?
Error from python compiler:
while data = await reader.readline(): ^ SyntaxError: invalid syntax