@decorators_mod.cached<EOL><INDENT>def slots(self):<DEDENT>
def grouped_slots():<EOL><INDENT>for cls in self.mro()[:-<NUM_LIT:1>]:<EOL><INDENT>try:<EOL><INDENT>cls_slots = cls._slots()<EOL><DEDENT>except NotImplementedError:<EOL><INDENT>continue<EOL><DEDENT>if cls_slots is not None:<EOL><INDENT>yield from cls_slots<EOL><DEDENT>else:<EOL><INDENT>yield None<EOL><DEDENT><DEDENT><DEDENT>if not self.newstyle:<EOL><INDENT>raise NotImplementedError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>slots = list(grouped_slots())<EOL>if not all(slot is not None for slot in slots):<EOL><INDENT>return None<EOL><DEDENT>return sorted(slots, key=lambda item: item.value)<EOL>
Get all the slots for this node.

        :returns: The names of slots for this class.
            If the class doesn't define any slot, through the ``__slots__``
            variable, then this function will return a None.
            Also, it will return None in the case the slots were not inferred.
        :rtype: list(str) or None