Module var

Variables with a functional interface:

  • v() -- return the value of v
  • v(x) -- set the value of v to x

For example:

v = v + 1 becomes v(v()+1)

Handy into the lambda expressions

Classes:
Var(object): Functional variables
Attributes:
_marker = object()

Class var.Var

Back to var

Bases:
object

Functional variables

Methods:
__call__(self, v=_marker): Return or set the value
__init__(self, v=None): Initialisation
__unicode__(self):
get(self): Return the value
render(self, renderer): When directly put into a XML tree, render its value
set(self, v): Set the value

Method var.Var.__call__

Back to var.Var

Arguments:
self, v=_marker

Return or set the value

In:
  • v -- if given, v becomes the new value
Return:
  • the variable value

Method var.Var.__init__

Back to var.Var

Arguments:
self, v=None

Initialisation

In:
  • v -- initial value

Method var.Var.get

Back to var.Var

Arguments:
self

Return the value

Return:
  • the value

Method var.Var.render

Back to var.Var

Arguments:
self, renderer

When directly put into a XML tree, render its value

In:
  • renderer -- the current renderer
Return:
  • the variable value

Method var.Var.set

Back to var.Var

Arguments:
self, v

Set the value

Return:
  • the value