Fix cache_multi_on_arguments (mostly) when used on a class method

Declined
#2 · Created  · Last updated

Declined pull request

I did it again — submitted a PR to myself.

Closed by: ·2014-03-16

Description

This patch fixes the CacheRegion.cache_multi_on_arguments decorator so that it will (mostly) work on class methods.

Some of these fixes are rather ugly. They would probably be prettier if function_multi_key_generator were dumbed down so that it doesn't try to ignore the first argument when the wrapped function appears to be a method, since we now have to add a dummy self argument when we call it from set, invalidate, and get.

Refresh is still broken for class methods. It might be possible to fix it by making the function_multi_key_generator return a property, but I say it's not worth it.

0 attachments

0 comments

Loading commits...