koolsb / pyblackbird

Python3 interface implementation for Monoprice Blackbird 4k 8x8 HDBaseT Matrix
MIT License
1 stars 16 forks source link

Drop `@asyncio.coroutine` in favor of async/await keywords #7

Closed balloob closed 1 year ago

balloob commented 3 years ago

Python 3.5 (released 2015) introduced new async and await keywords. They replace the @asyncio.coroutine decorator and yield from.

The @asyncio.coroutine decorator has been deprecated in Python 3.8 and will be removed in Python 3.10.

It would be great if this package could migrate to using async and await keywords.

# Old
@asyncio.coroutine
def something():
    yield from asyncio.sleep(1)

# New
async def something():
    await asyncio.sleep(1)