[Python-checkins] cpython (3.3): #16728: Mention collections.abc.Sequence in 'sequence' glossary entry

andrew.kuchling python-checkins at python.org
Sat Feb 15 23:11:18 CET 2014


http://hg.python.org/cpython/rev/30d0816939a3
changeset: 89209:30d0816939a3
branch: 3.3
parent: 89207:3352b5abe1e4
user: Andrew Kuchling <amk at amk.ca>
date: Sat Feb 15 17:05:26 2014 -0500
summary:
 #16728: Mention collections.abc.Sequence in 'sequence' glossary entry
files:
 Doc/glossary.rst | 8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -763,6 +763,14 @@
 mapping rather than a sequence because the lookups use arbitrary
 :term:`immutable` keys rather than integers.
 
+ The :class:`collections.abc.Sequence` abstract base class
+ defines a much richer interface that goes beyond just
+ :meth:`__getitem__` and :meth:`__len__`, adding :meth:`count`,
+ :meth:`index`, :meth:`__contains__`, and
+ :meth:`__reversed__`. Types that implement this expanded
+ interface can be registered explicitly using
+ :func:`~abc.register`.
+
 slice
 An object usually containing a portion of a :term:`sequence`. A slice is
 created using the subscript notation, ``[]`` with colons between numbers
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /