Ivan Pozdeev via Python-Dev wrote:
the documentation seems to use "sequence" in the sense "finite iterable". Functions that need to know the length of input in advance seem to be the minority.
The official classifications we have are: Sequence: __iter__, __getitem__, __len__ Iterable: __iter__ There isn't any official term for a sequential thing that has __iter__ and __getitem__ but not __len__. That's probably because the need for such a thing doesn't seem to come up very much. One usually processes a potentially infinite sequence by iterating over it, not picking things out at arbitrary positions. And usually its items are generated by an algorithm that works sequentially, so random access would be difficult to implement. -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com