I've report http://bugs.python.org/issue16728 , but I am confused
about what is the sequence now.


Glossary defines sequence as iteratable having __getitem__ and __len__.
Objects doesn't have __iter__ is iterable when it having __getitem__.

http://docs.python.org/3/reference/datamodel.html says:

> Sequences also support slicing: a[i:j] selects all items with index k such that i <= k < j. When used as an expression, a slice is a sequence of the same type. This implies that the index set is renumbered so that it starts at 0.

But I think this sentence explains about standard types and not definition of sequence.


http://docs.python.org/3/library/collections.abc.html says:

> This module provides abstract base classes that can be used to test whether a class provides a particular interface; for example, whether it is hashable or whether it is a mapping.

And collections.abc.Sequence requires "index()" and "count()".

What is the requirement for calling something is "sequence"?

Off Topc: Sequence.__iter__ uses __len__ and __getitem__ but default iterator uses only __getitem__. This difference is ugly.


--
INADA Naoki  <songofacandy@gmail.com>