cached-property
cached-property copied to clipboard
DeprecationWarning: "@coroutine" decorator is deprecated
Module cached_property.py, function wrapper
, declared in line 42, uses decorator @asyncio.coroutine
.
It seems that the asyncio @coroutine
decorator is deprecated since Python 3.8.
Please use async def
instead.
Source code should be modified to look like:
def _wrap_in_coroutine(self, obj):
@wraps(obj)
async def wrapper():
future = asyncio.ensure_future(self.func(obj))
obj.__dict__[self.func.__name__] = future
return future
return wrapper()
See https://github.com/pydanny/cached-property/pull/267
Thank you @encukou! But does this mean that the issue is now resolved in cached_property.py
?
No, it would need to be merged & released.