I am quite often using Python instead of pseudocode. For that, I would like to have a stack. I know that using lists is the way to go (source), but I would like to use myList.push rather than myList.append to make clear that I use a stack.
I thought I could do something simple like
myList.push = myList.append
to define an alias for the append operation, but I get
stack.push = stack.append
AttributeError: 'list' object has no attribute 'push'
Does a short solution for adding a push-operation to a list exist?
(It should not mess up my runnable Python-pseudocode)
list.append(x)where the alias would be something likepush(x)?