web.web.template.ForLoop

Package web :: Package web :: Module template :: Class ForLoop |
[hide private]
[frames] | no frames]

# Class ForLoop

source code

Wrapper for expression in for stament to support loop.xxx helpers.

    >>> loop = ForLoop()
    >>> for x in loop.setup(['a', 'b', 'c']):
    ...     print loop.index, loop.revindex, loop.parity, x
    ...
    1 3 odd a
    2 2 even b
    3 1 odd c
    >>> loop.index
    Traceback (most recent call last):
        ...
    AttributeError: index

Instance Methods | [hide private]
__init__(self) | source code
__getattr__(self, name) | source code
setup(self, seq) | source code
_push(self) | source code
_pop(self) | source code