Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
dogpile cache_on_arguments default key generation
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jonathan Vanasco  
View profile  
 More options Sep 18 2012, 2:04 pm
From: Jonathan Vanasco <jonat...@findmeon.com>
Date: Tue, 18 Sep 2012 11:04:21 -0700 (PDT)
Local: Tues, Sep 18 2012 2:04 pm
Subject: dogpile cache_on_arguments default key generation

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.

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mike bayer  
View profile  
 More options Sep 18 2012, 2:11 pm
From: mike bayer <mike...@zzzcomputing.com>
Date: Tue, 18 Sep 2012 11:11:09 -0700 (PDT)
Local: Tues, Sep 18 2012 2:11 pm
Subject: Re: dogpile cache_on_arguments default key generation

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

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Vanasco  
View profile  
 More options Sep 18 2012, 2:25 pm
From: Jonathan Vanasco <jonat...@findmeon.com>
Date: Tue, 18 Sep 2012 11:25:05 -0700 (PDT)
Local: Tues, Sep 18 2012 2:25 pm
Subject: Re: dogpile cache_on_arguments default key generation

i'm not sure what i looked at either, but that's the answer i was hoping
for.

i think i saw line in region.cache_on_arguments ( key = key_generator(*arg,
**kw) ) and missed the valueerror in util

i also have a much older version of dogpile, as my line numbers are way off

anyways, great answer! thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Bayer  
View profile  
 More options Sep 18 2012, 2:45 pm
From: Michael Bayer <mike...@zzzcomputing.com>
Date: Tue, 18 Sep 2012 14:45:00 -0400
Subject: Re: dogpile cache_on_arguments default key generation

On Sep 18, 2012, at 2:25 PM, Jonathan Vanasco wrote:

> i'm not sure what i looked at either, but that's the answer i was hoping for.

> i think i saw line in region.cache_on_arguments ( key = key_generator(*arg, **kw) ) and missed the valueerror in util

> i also have a much older version of dogpile, as my line numbers are way off

ah, well the whole thing is barely out of alpha so I'd definitely track the latest code ....

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »