class Pile(list):
    def empiler(self, v):
        self.append(v)
    def depiler(self):
        return self.pop(-1)

p = Pile()
p.empiler(3)
p.empiler(4)
p.empiler(1)
p.empiler(5)
print(p)                # → [3, 4, 1, 5]
print(p.depiler())      # → 5
print(p.depiler())      # → 1
p.empiler(8)
print(p)                # → [3, 4, 8]
