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*<http://docs.python.org/3/glossary.html#term-abstract-base-class>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 at gmail.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20121221/11656073/attachment-0001.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4