summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-04-14 08:50:05 (GMT)
committerGeorg Brandl <georg@python.org>2013-04-14 08:50:05 (GMT)
commit5f4b4ac73e172f486c0a50c1e78e20da9b727784 (patch)
tree8f12fa7ace78d1269d58eaee578fd3f408a0aa68 /Doc
parent7b8c1324d756c30c8852269153a7a1ebf240376b (diff)
downloadcpython-5f4b4ac73e172f486c0a50c1e78e20da9b727784.zip
cpython-5f4b4ac73e172f486c0a50c1e78e20da9b727784.tar.gz
cpython-5f4b4ac73e172f486c0a50c1e78e20da9b727784.tar.bz2
Update code examples using collections.abc classes.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/collections.abc.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst
index 115ce10..06dfe80 100644
--- a/Doc/library/collections.abc.rst
+++ b/Doc/library/collections.abc.rst
@@ -128,7 +128,7 @@ These ABCs allow us to ask classes or instances if they provide
particular functionality, for example::
size = None
- if isinstance(myvar, collections.Sized):
+ if isinstance(myvar, collections.abc.Sized):
size = len(myvar)
Several of the ABCs are also useful as mixins that make it easier to develop
@@ -138,7 +138,7 @@ abstract methods: :meth:`__contains__`, :meth:`__iter__`, and :meth:`__len__`.
The ABC supplies the remaining methods such as :meth:`__and__` and
:meth:`isdisjoint`::
- class ListBasedSet(collections.Set):
+ class ListBasedSet(collections.abc.Set):
''' Alternate set implementation favoring space over speed
and not requiring the set elements to be hashable. '''
def __init__(self, iterable):