...

/

The Iterable Protocol

The Iterable Protocol

Learn how to implement the iterable protocol.

We'll cover the following...

The iterable protocol defines a standardized means for an object to return an iterator. Such objects are called iterables. Usually, an iterable is a container of elements, such as a data structure, but it can also be an object virtually representing a set of elements, such as a Directory object, which would allow us to iterate over the files in a directory. ...