title: Dictionary assignment in python or strange abstraction
body: <p>I'm reading a book on data structures and algorithms and understand the overall goal of the code but for top() and pop() there are strange member variables. Is this some sort of python abstraction that I am running into (ex. self._head._element) or a feature of not using pythons dictionary variable assignment? 
  '''</p>
  
  <pre><code>class LinkedStack:
      class _Node:
          __slots__ = '_element','_next' #treats elements not like a dictionary
  
          def __init__(self, element, next):
              self._element = element
              self._next = next
  
  def __init__(self):
      self._head = None
      self._size = 0
  
  def __len__(self):
      return self._size
  
  def is_empty(self):
      return self._size == 0
  
  def push(self, e):
      self._head = self._Node(e, self._head)
      self._size += 1
  
  def top(self):
      if self.is_empty():
          raise Empty('Stack is empty')
      else:
          return self._head._element  
  
  def pop(self):
      if self.is_empty():
          raise Empty('Stack is empty')
      answer = self._head._element
      self._head = self._head._next
      self._size -=1
      return answer
  </code></pre>
  
  <p>'''       </p>