Module config :: Class Expression
[show private | hide private]
[frames | no frames]

Type Expression

object --+
         |
        Expression


This internal class implements a value which is obtained by evaluating an expression.
Method Summary
  __init__(self, op, lhs, rhs)
Initialize an instance.
  __repr__(self)
  __str__(self)
any evaluate(self, container)
Evaluate this instance in the context of a container.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Method Details

__init__(self, op, lhs, rhs)
(Constructor)

Initialize an instance.
Parameters:
op - the operation expressed in the expression.
           (type=PLUS, MINUS, STAR, SLASH, MOD)
lhs - the left-hand-side operand of the expression.
           (type=any Expression or primary value.)
rhs - the right-hand-side operand of the expression.
           (type=any Expression or primary value.)
Overrides:
__builtin__.object.__init__

__repr__(self)
(Representation operator)

Overrides:
__builtin__.object.__repr__

__str__(self)
(Informal representation operator)

Overrides:
__builtin__.object.__str__

evaluate(self, container)

Evaluate this instance in the context of a container.
Parameters:
container - The container to evaluate in from.
           (type=Container)
Returns:
The evaluated value.
           (type=any)
Raises:
ConfigResolutionError - If evaluation fails.
ZeroDivideError - If division by zero occurs.
TypeError - If the operation is invalid, e.g. subtracting one string from another.