parameters: (cls)
return_statement: return names
docstring: 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.)
docstring_summary: Return a list of slot names for a given class.
docstring_tokens: Return a list of slot names for a given class .
function: def _slotnames(cls):
      """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.)
      """
  
      # Get the value from a cache in the class if possible
      names = cls.__dict__.get("__slotnames__")
      if names is not None:
          return names
  
      # Not cached -- calculate the value
      names = []
      if not hasattr(cls, "__slots__"):
          # This class has no slots
          pass
      else:
          # Slots found -- gather slot names from all base classes
          for c in cls.__mro__:
              if "__slots__" in c.__dict__:
                  slots = c.__dict__['__slots__']
                  # if class has a single slot, it can be given as a string
                  if isinstance(slots, basestring):
                      slots = (slots,)
                  for name in slots:
                      # special descriptors
                      if name in ("__dict__", "__weakref__"):
                          continue
                      # mangled names
                      elif name.startswith('__') and not name.endswith('__'):
                          stripped = c.__name__.lstrip('_')
                          if stripped:
                              names.append('_%s%s' % (stripped, name))
                          else:
                              names.append(name)
                      else:
                          names.append(name)
  
      # Cache the outcome in the class if at all possible
      try:
          cls.__slotnames__ = names
      except:
          pass # But don't die if we can't
  
      return names
function_tokens: def _slotnames ( cls ) : # Get the value from a cache in the class if possible names = cls . __dict__ . get ( "__slotnames__" ) if names is not None : return names # Not cached -- calculate the value names = [ ] if not hasattr ( cls , "__slots__" ) : # This class has no slots pass else : # Slots found -- gather slot names from all base classes for c in cls . __mro__ : if "__slots__" in c . __dict__ : slots = c . __dict__ [ '__slots__' ] # if class has a single slot, it can be given as a string if isinstance ( slots , basestring ) : slots = ( slots , ) for name in slots : # special descriptors if name in ( "__dict__" , "__weakref__" ) : continue # mangled names elif name . startswith ( '__' ) and not name . endswith ( '__' ) : stripped = c . __name__ . lstrip ( '_' ) if stripped : names . append ( '_%s%s' % ( stripped , name ) ) else : names . append ( name ) else : names . append ( name ) # Cache the outcome in the class if at all possible try : cls . __slotnames__ = names except : pass # But don't die if we can't return names