Back to index

plone3  3.1.7
Functions | Variables
plone.memoize.forever Namespace Reference


def memoize


dictionary _memos = {}
tuple __all__ = (memoize,)

Detailed Description

Memo decorators for globals - memoized values survive for as long as the
process lives.

Stores values in a module-level variable.

Pay attention that is module is not thread-safe, so use it with care.

Function Documentation

Definition at line 14 of file

00015 def memoize(fun):
00016     def get_key(fun, *args, **kwargs):
00017         return (args, frozenset(kwargs.items()),)
00018     def get_cache(fun, *args, **kwargs):
00019         return _memos
00020     return volatile.cache(get_key, get_cache)(fun)

Variable Documentation

Definition at line 21 of file

Definition at line 12 of file