def _slotnames(cls):
<EOL>names = cls.__dict__.get("<STR_LIT>")<EOL>if names is not None:<EOL><INDENT>return names<EOL><DEDENT>names = []<EOL>if not hasattr(cls, "<STR_LIT>"):<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>for c in cls.__mro__:<EOL><INDENT>if "<STR_LIT>" in c.__dict__:<EOL><INDENT>slots = c.__dict__['<STR_LIT>']<EOL>if isinstance(slots, str):<EOL><INDENT>slots = (slots,)<EOL><DEDENT>for name in slots:<EOL><INDENT>if name in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>continue<EOL><DEDENT>elif name.startswith('<STR_LIT>') and not name.endswith('<STR_LIT>'):<EOL><INDENT>stripped = c.__name__.lstrip('<STR_LIT:_>')<EOL>if stripped:<EOL><INDENT>names.append('<STR_LIT>' % (stripped, name))<EOL><DEDENT>else:<EOL><INDENT>names.append(name)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>names.append(name)<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>try:<EOL><INDENT>cls.__slotnames__ = names<EOL><DEDENT>except:<EOL><INDENT>pass <EOL><DEDENT>return names<EOL>
Return a list of slot names for a given class.

    This needs to find slots defined by the class and its bases, so we
    can't simply return the __slots__ attribute.  We must walk down
    the Method Resolution Order and concatenate the __slots__ of each
    class found there.  (This assumes classes don't modify their
    __slots__ attribute to misrepresent their slots after the class is
    defined.)