On Tuesday, September 18, 2012 2:04:21 PM UTC-4, Jonathan Vanasco wrote:
>
> i'm redoing dogpile caching on my app, and looking into cache_on_arguments
>
> the docs say "The default key generation will use the name of the 
> function, the module name for the function, the arguments passed, as well 
> as an optional “namespace” parameter in order to generate a cache key."
>
> looking at the code, cache_on_arguments will create a cache key based on 
> the args but not the kwargs.
>
 

>
> is this the intended behavior ?  the decorator passes in all the kwargs, 
> though I believe that is just to get the namespace and expiry info.
>

not sure which code you looked at, as the actual code that generates the 
key is here:

https://bitbucket.org/zzzeek/dogpile.cache/src/6c95329bb5a3/dogpile/cache/util.py#cl-58

and you'll see it explicitly raises an exception if **kw is present.   So 
yes, this is intentional.    the function is intended to be replaced with 
whatever you want via the function_key_generator argument passed to 
make_region().


 

>
> i just want to be sure that the default intended behavior was to interpret 
> "arguments" as "args, but not kwargs"
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pylons-discuss/-/RXWW2_C0h1kJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to