Fix cache_multi_on_arguments when used on a class method
Jeff Dairiki
Branch: dairiki/dogpile.cache:bug.cache-multi-on-method
Branch: zzzeek/dogpile.cache:master
Declined
Declined pull request
we've moved over to github. issue is now over at https://github.com/sqlalchemy/dogpile.cache/issues/95. feel free to re-propose over there.
Closed by: Mike Bayer·2018-11-25
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.