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.
Function keep​_lazy No summary
Function keep​_lazy​_text A decorator for functions that accept lazy arguments and return text.
Variable empty Undocumented
Class ​Lazy​Object 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 ​Simple​Lazy​Object A lazy object initialized from any function.
Function ​_lazy​_proxy​_unpickle Undocumented
Function lazy No summary
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.
def keep_lazy(*resultclasses):
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):
A decorator for functions that accept lazy arguments and return text.
empty =

Undocumented

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

Undocumented

def lazy(func, *resultclasses):
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):
Shortcut for the common case of a lazy callable that returns str.
def new_method_proxy(func):

Undocumented

def partition(predicate, values):

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):
Used to unpickle lazy objects. Just return its argument, which will be the wrapped object.