Home | Trees | Indices | Help |
|
---|
|
A few useful function/method decorators.
Classes | |
cached_decorator | |
cachedproperty Provides a cached property equivalent to the stacking of @cached and @property, but more efficient. |
|
wproperty Simple descriptor expecting to take a modifier function as first argument and looking for a _<function name> to retrieve the attribute. |
|
classproperty this is a simple property-like class but for class attributes. |
|
iclassmethod Descriptor for method which should be available as class method if called on the class or instance method if called on an instance. |
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Function Details |
Clear a cache handled by the :func:`cached` decorator. If 'x' class has @cached on its method `foo`, type >>> clear_cache(x, 'foo') to purge this method's cache on the instance. |
Decorator extending class with the decorated callable. This is basically a syntactic sugar vs class assignment. >>> class A: ... pass >>> @monkeypatch(A) ... def meth(self): ... return 12 ... >>> a = A() >>> a.meth() 12 >>> @monkeypatch(A, 'foo') ... def meth(self): ... return 12 ... >>> a.foo() 12 |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Aug 1 22:58:57 2015 | http://epydoc.sourceforge.net |