On Sat, Oct 08, 2005 at 01:53:28PM +0000, Duncan Booth wrote: > Unless the results stored in the cache are very large data structures, I > would suggest that you simply store (args,kwargs) as the cache key and > accept the hit that sometime you'll cache the same call multiple times.
... except that dicts cannot be dict keys
Another 'memoize' decorator uses this to get the key:
kw = kwargs.items()
kw.sort()
key = (args, tuple(kw))
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/325905
Jeff
pgp4a5R0heoxU.pgp
Description: PGP signature
-- http://mail.python.org/mailman/listinfo/python-list
