Logo Search packages:      
Sourcecode: zope-loginmanager version File versions

ZPatterns::Expressions::Expression Class Reference

Inherits ExtensionClass::Base.

List of all members.

Detailed Description

DTML (restricted Python) Expression object that can be pickled

To use, create with 'Expression("some string")'.  You can then save the
created object as an attribute of any 'Persistent' object, and it will be
properly pickled, without writing any actual Python bytecode to the ZODB.

The secret is that the '_v_expr' computed attribute automatically recompiles
the expression whenever it's needed, but caches it while the 'Expression' is
in memory to avoid unnecessary re-compiling.

To compute the result of the expression, call its 'eval()' method, passing
in a 'NamespaceStack' object.

Definition at line 83 of file Expressions.py.

Public Member Functions

def __getstate__
def __init__
def __setstate__
def eval

Public Attributes


Private Member Functions

def _v_expr

Private Attributes


Static Private Attributes

tuple _v_expr = ComputedAttribute(_v_expr)

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index