How to create your own iterator or iterable? In Python, we have two complementary terms: iterator and iterable. An iterable is an object that has an __iter__ method which returns an iterator, or which defines a __getitem__ method that can take sequential indexes starting from zero (and raises an IndexError when the indexes are no longer valid). So, you get the iterator from the iterable object. By default __iter__ always returns self.