¡@

Home 

python Programming Glossary: iteratorwrapper2

Python iterators ??how to dynamically assign self.next within a new style class?

http://stackoverflow.com/questions/1152238/python-iterators-how-to-dynamically-assign-self-next-within-a-new-style-class

# other arbitrary resource cleanup code here class IteratorWrapper2 object def __init__ self otheriter self._iterator otheriter.. for i in IteratorWrapper1 iter 1 2 3 print i for j in IteratorWrapper2 iter 1 2 3 print j Gives the following output 1 2 3 Traceback.. last ... TypeError iter returned non iterator of type 'IteratorWrapper2' python iterator share improve this question What you're..