cached-property icon indicating copy to clipboard operation
cached-property copied to clipboard

DeprecationWarning: "@coroutine" decorator is deprecated

Open ylassoued opened this issue 2 years ago • 3 comments

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()

ylassoued avatar Mar 24 '22 12:03 ylassoued

See https://github.com/pydanny/cached-property/pull/267

encukou avatar Sep 14 '22 07:09 encukou

Thank you @encukou! But does this mean that the issue is now resolved in cached_property.py?

ylassoued avatar Sep 14 '22 07:09 ylassoued

No, it would need to be merged & released.

encukou avatar Sep 14 '22 08:09 encukou