DEV Community

Discussion on: Python auto refresh cache

defman profile image
Sergey Kislyakov πŸ‡·πŸ‡Ί πŸ‡ΊπŸ‡Έ

Hey, could you explain why there's an argument called func_ in your decorator? Is it there for wrapping functions somehow like this: cached_func = cach_it(some_func, as_daemon=True) instead of cached_func = cach_it(as_daemon=True)(some_func)? I've never seen that way in before.

balighmehrez profile image
BalighMehrez Author

it is to make decorator work with or without arguments
as discussed on this topic