[cpython 3.9] Decorating a classmethod doesn't work #511
Open
Description
It appears that alru_cache
does not seem to work for classmethods. Here's a contrived example.
import asyncio
from async_lru import alru_cache
class Incrementer:
inc = 1
@classmethod
@alru_cache
async def increment(cls, num):
return cls.inc + num
async def main():
print(await Incrementer.increment(5))
asyncio.run(main())
Error:
TypeError: increment() missing 1 required positional argument: 'num'
I would expect it to work since lru_cache
works for classmethods.
Metadata
Assignees
Labels
No labels