def slots(cls):
    """Return a sequence of all slots in a class in MRO definition
    order."""

    return (
        s for c in reversed(cls.__mro__)
        if hasattr(c, '__slots__')
        for s in c.__slots__
        if not s.startswith('_')
    )