merge with 3.3

This commit is contained in:
Georg Brandl 2013-04-14 10:50:13 +02:00
commit f221377d8b

View file

@ -128,7 +128,7 @@ These ABCs allow us to ask classes or instances if they provide
particular functionality, for example:: particular functionality, for example::
size = None size = None
if isinstance(myvar, collections.Sized): if isinstance(myvar, collections.abc.Sized):
size = len(myvar) size = len(myvar)
Several of the ABCs are also useful as mixins that make it easier to develop 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 The ABC supplies the remaining methods such as :meth:`__and__` and
:meth:`isdisjoint`:: :meth:`isdisjoint`::
class ListBasedSet(collections.Set): class ListBasedSet(collections.abc.Set):
''' Alternate set implementation favoring space over speed ''' Alternate set implementation favoring space over speed
and not requiring the set elements to be hashable. ''' and not requiring the set elements to be hashable. '''
def __init__(self, iterable): def __init__(self, iterable):