Iterator
-
IteratorModeling/DesignPattern 2020. 2. 29. 19:01
1. Overview Iterator allows a way to access elements/children of an aggregate object in sequence while hiding the actual internal data structure used. In Java language, iterators are an integral part of collection frameworks and they are implementations of this design pattern. Iterators are stateful, meaning an iterator object remembers its position while iterating Iterators can become out of sy..
-
iterator, iterable, iteration, iterator protocol, generator functions, generator expressions, and lazy evaluationDynamicPL/Python 2019. 10. 22. 08:44
1. Overview In Python, iterable and iterator have specific meanings. How the iteration in Python works under the hood What are iterables and iterators and how to create them What is the iterator protocol What is a lazy evaluation What are the generator functions and generator expressions 2. Description 2.1 Loop 2.1.1 For Loop Python has something called for loop, but it works like a foreach loop..