class documentation
class countable: (source)
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 |
Undocumented |
Instance Variable | _it |
Undocumented |