@classmethod
def __subclasshook__(cls, candidate):
    EXPECTED_ATTRS = ('__getitem__', '__iter__')
    return all((hasattr(candidate, attr) for attr in EXPECTED_ATTRS))
@classmethod
def __subclasshook__(cls, candidate):
    EXPECTED_ATTRS = ('__getitem__', '__iter__')
    return all((hasattr(candidate, attr) for attr in EXPECTED_ATTRS))