In python, an object X with the single property that it may return an iterator when you ask it nicely with the iter(X) function, which really just calls the X.__iter__ method. The iterator does all the work, but the iterable object stores the data (if it's a container you're implementing) or the enumeration parameters (if you're implementing some non-trivial or just very large enumeration scheme). It's also what most functions will want to hold onto or pass around, whereas the iterator should only be used by the yucky internals.

Log in or registerto write something here or to contact authors.