Fix cache_multi_on_arguments when used on a class method

Declined
#14 · Created  · Last updated

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: ·2018-11-25

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...