wrf.IterWrapper¶
-
class
wrf.
IterWrapper
(wrapped)¶ A wrapper class for generators and custom iterable classes that returns a new iterator to the start of the sequence when
IterWrapper.__iter__()
is called.If the wrapped object is a generator, a copy of the generator is constructed and returned when
IterWrapper.__iter__()
is called. If the wrapped object is a custom type, then thecopy.copy()
is called and a new instance is returned. In both cases, the original iterable object is unchanged.Note
Do not increment the wrapped iterable outside of this wrapper.
-
__init__
(wrapped)¶ Initialize an
wrf.IterWrapper
object.Parameters: wrapped (an iterable object) – Any iterable object that contains the __iter__ method.
Methods
__init__
(wrapped)Initialize an wrf.IterWrapper
object.-