Fix cache_multi_on_arguments (mostly) when used on a class method
Jeff Dairiki
Branch: bug.cache-multi-on-method
Branch: master
Declined
Declined pull request
I did it again — submitted a PR to myself.
Closed by: Jeff Dairiki·2014-03-16
I did it again — submitted a PR to myself.
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 dummyself
argument when we call it fromset
,invalidate
, andget
.Refresh
is still broken for class methods. It might be possible to fix it by making thefunction_multi_key_generator
return aproperty
, but I say it's not worth it.