Ejemplo n.º 1
0
 def __init__(self, start=[]):  # extend the 'new' operation
     Stack.__init__(self)  # initialize stack from any sequence
     for str in start:  # start can be another stack too
         self.push(str)
Ejemplo n.º 2
0
 def __getitem__(self, i):           # extend 'item' to trace accesses
     print 'accessing cell', i
     return Stack.__getitem__(self, i)
Ejemplo n.º 3
0
 def __getitem__(self, i):  # extend 'item' to trace accesses
     print 'accessing cell', i
     return Stack.__getitem__(self, i)
Ejemplo n.º 4
0
 def __init__(self, start=[]):       # extend the 'new' operation
     Stack.__init__(self)            # initialize stack from any sequence
     for str in start:               # start can be another stack too
         self.push(str)