class documentation

class LoopContext(object):

View In Hierarchy

A magic loop variable. Automatically accessible in any % for block.

See the section :ref:`loop_context` for usage notes.

parent -> .LoopContext or None
The parent loop, if one exists.
index -> int
The 0-based iteration count.
reverse_index -> int
The number of iterations remaining.
first -> bool
True on the first iteration, False otherwise.
last -> bool
True on the last iteration, False otherwise.
even -> bool
True when index is even.
odd -> bool
True when index is odd.
Method cycle Cycle through values as the loop progresses.
Method __init__ Undocumented
Method __iter__ Undocumented
Method __len__ Undocumented
Instance Variable ​_iterable Undocumented
Instance Variable index Undocumented
Instance Variable parent Undocumented
Property even Undocumented
Property first Undocumented
Property last Undocumented
Property odd Undocumented
Property reverse​_index Undocumented
def cycle(self, *values):
Cycle through values as the loop progresses.
def __init__(self, iterable):

Undocumented

def __iter__(self):

Undocumented

@util.memoized_instancemethod
def __len__(self):

Undocumented

_iterable =

Undocumented

index: int =

Undocumented

parent =

Undocumented

@property
even =

Undocumented

@property
first =

Undocumented

@property
last =

Undocumented

@property
odd =

Undocumented

@property
reverse_index =

Undocumented