def find_slots(cls):
    """Return a set of all slots for a given class and its parents"""

    slots = set()
    for c in cls.__mro__:
        cslots = getattr(c, "__slots__", tuple())

        if not cslots:
            continue
        elif isinstance(cslots, (bstr, ustr)):
            cslots = (cslots,)

        slots.update(cslots)

    return slots
def find_slots ( cls ) : slots = set ( ) for c in cls . __mro__ : cslots = getattr ( c , "__slots__" , tuple ( ) ) if not cslots : continue elif isinstance ( cslots , ( bstr , ustr ) ) : cslots = ( cslots , ) slots . update ( cslots ) return slots
Return a set of all slots for a given class and its parents