class documentation

class LoopContext: (source)

View In Hierarchy

A magic loop variable. Automatically accessible in any ``% for`` block. See the section :ref:`loop_context` for usage notes. :attr:`parent` -> :class:`.LoopContext` or ``None`` The parent loop, if one exists. :attr:`index` -> `int` The 0-based iteration count. :attr:`reverse_index` -> `int` The number of iterations remaining. :attr:`first` -> `bool` ``True`` on the first iteration, ``False`` otherwise. :attr:`last` -> `bool` ``True`` on the last iteration, ``False`` otherwise. :attr:`even` -> `bool` ``True`` when ``index`` is even. :attr:`odd` -> `bool` ``True`` when ``index`` is odd.

Method __init__ Undocumented
Method __iter__ Undocumented
Method __len__ Undocumented
Method cycle Cycle through values as the loop progresses.
Instance Variable index Undocumented
Instance Variable parent Undocumented
Property even Undocumented
Property first Undocumented
Property last Undocumented
Property odd Undocumented
Property reverse_index Undocumented
Instance Variable _iterable Undocumented
def __init__(self, iterable): (source)

Undocumented

def __iter__(self): (source)

Undocumented

Undocumented

def cycle(self, *values): (source)

Cycle through values as the loop progresses.

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

@property
reverse_index = (source)

Undocumented

_iterable = (source)

Undocumented