title: Stack data structure in Python using lists
body: <p>For the <code>stack</code> class below</p>
  
  <pre><code>class stack(list):
      def __init__(self):
          self.stack = []
          self.top = -1
      def isempty(self):
          return self.stack == []
      def push(self,x):
          S.top = S.top + 1
          return self.stack.append(x)
  
  S = stack()
  S.isempty() #True
  S.push(5)  #[5]
  S.push(100) #[5,100]
  print(S) # Returns empty stack []
  </code></pre>
  
  <p>Why does it not return the updated <code>[5,100]</code>?</p>