There is NO difference, only the first names the individual arguments, you can call memcache.add(time=3600, value=query ,key="Registration'+users.get_current_user()" ) and get the same result. The second versions uses the position of the arguments.
I noticed some strange things with the quotes, single and double, are they exactly as given in the examples? users.get_current_user() returns a User object, this might not work very well in adding to a String unless Python calls the __str__() method on the User object because we try to add to a string. 2008/12/31 Toney <[email protected]>: > > I'm optimizing my code to use memcache, can anyone tell me the > difference between using memcache like this... > > memcache.add(key="Registration'+users.get_current_user()", > value=query, time=3600) > > versus this way... > > memcache.add('Registration'+users.get_current_user(), query > > I found one way while watching the building-scalable-web-applications- > with-google-app-engine video and the other in the memcache > documentation. > > I'm thinking the second example appends data to the memcachce key and > the first replaces what's in the specific memcache key with the new > value. or is there no difference?? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" 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/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
