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
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):