module documentation

Undocumented

Class cached_property Decorator that converts a method with a single self argument into a property cached on the instance.
Class classproperty Decorator that converts a method with a single cls argument into a property that can be accessed directly from the class.
Class LazyObject A wrapper for another class that can be used to delay instantiation of the wrapped class.
Class Promise Base class for the proxy class created in the closure of the lazy function. It's used to recognize promises in code.
Class SimpleLazyObject A lazy object initialized from any function.
Function keep_lazy A decorator that allows a function to be called with one or more lazy arguments. If none of the args are lazy, the function is evaluated immediately, otherwise a __proxy__ is returned that will evaluate the function when needed.
Function keep_lazy_text A decorator for functions that accept lazy arguments and return text.
Function lazy Turn any callable into a lazy evaluated callable. result classes or types is required -- at least one is needed so that the automatic forcing of the lazy evaluation code is triggered. Results are not memoized; the function is evaluated on every access.
Function lazystr Shortcut for the common case of a lazy callable that returns str.
Function new_method_proxy Undocumented
Function partition Split the values into two sets, based on the return value of the function (True/False). e.g.:
Function unpickle_lazyobject Used to unpickle lazy objects. Just return its argument, which will be the wrapped object.
Variable empty Undocumented
Function _lazy_proxy_unpickle Undocumented
def keep_lazy(*resultclasses): (source)

A decorator that allows a function to be called with one or more lazy arguments. If none of the args are lazy, the function is evaluated immediately, otherwise a __proxy__ is returned that will evaluate the function when needed.

def keep_lazy_text(func): (source)

A decorator for functions that accept lazy arguments and return text.

def lazy(func, *resultclasses): (source)

Turn any callable into a lazy evaluated callable. result classes or types is required -- at least one is needed so that the automatic forcing of the lazy evaluation code is triggered. Results are not memoized; the function is evaluated on every access.

def lazystr(text): (source)

Shortcut for the common case of a lazy callable that returns str.

def new_method_proxy(func): (source)

Undocumented

def partition(predicate, values): (source)

Split the values into two sets, based on the return value of the function (True/False). e.g.: >>> partition(lambda x: x > 3, range(5)) [0, 1, 2, 3], [4]

def unpickle_lazyobject(wrapped): (source)

Used to unpickle lazy objects. Just return its argument, which will be the wrapped object.

Undocumented

def _lazy_proxy_unpickle(func, args, kwargs, *resultclasses): (source)

Undocumented