slazarov / python-signalr-client

SignalR client for python based on asyncio.
MIT License
33 stars 22 forks source link

python 3.4? #1

Closed Serpens66 closed 6 years ago

Serpens66 commented 6 years ago

Hi, thank you very much for this. I don't like the "wait" thing with the other signalR module, so I think async is a nice solution. Unfortunately I still use python 3.4 and don't want to update.

So can I simply replace: 1) "async def..." with "@asyncio.coroutine def ..."

2) "await" with "yield from"

3) "async with session.get(url) as r:" with "r = yield from session.get(url)"

and everything is fine? Or is it more complex?

edit: Just saw you also use "async for".. I found no short alternative for this, just a big block of code in last example of response here: https://stackoverflow.com/questions/34338518/async-for-in-python-3-4

slazarov commented 6 years ago

I haven't used asyncio before py3.5 but from what I read this should suffice. I recommend either reading about what changes were made and reverse them or the better solution: update to py3.5.