class documentation

class countable: (source)

View In Hierarchy

Wrap *iterable* and keep a count of how many items have been consumed. The ``items_seen`` attribute starts at ``0`` and increments as the iterable is consumed: >>> iterable = map(str, range(10)) >>> it = countable(iterable) >>> it.items_seen 0 >>> next(it), next(it) ('0', '1') >>> list(it) ['2', '3', '4', '5', '6', '7', '8', '9'] >>> it.items_seen 10

Method __init__ Undocumented
Method __iter__ Undocumented
Method __next__ Undocumented
Instance Variable items_seen Undocumented
Instance Variable _it Undocumented
def __init__(self, iterable): (source)

Undocumented

def __iter__(self): (source)

Undocumented

def __next__(self): (source)

Undocumented

items_seen: int = (source)

Undocumented

Undocumented