James Bennett wrote: > On 1/31/07, Joseph Perla <[EMAIL PROTECTED]> wrote: > >> Along the lines of get_or_create(), does it make sense to implement a >> get_or_set() function for quick caches? >> > > I'm not sure I see the use case here; it only works when the code to > calculate the expensive value can be fit into a single statement, and > (in my experience at least) that's not usually how things work. > I've been writing my own cache wrapper and I added something similar to this. If the computations are expensive, it's helpful.
You of course wouldn't /have/ to use a lambda, you could pass in whatever function you wanted. lambda is just for example purposes. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. 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/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
