def __getitem__(cls, idx):
    """Emulate __class_getitem__ for Python < 3.7"""
    try:
        return cls.__class_getitem__(idx)
    except AttributeError:
        raise TypeError('{!r} object is not subscriptable'.format(cls.__name__)
            )
