By default push(obj) would insert an object to the end of the list, while push(obj, index) would insert the object at index, just like pop() removes (and returns) the object at the end of the list, and pop(index) removes (and returns) the object at the index.
I found little discussion on this, just this SO thread
http://stackoverflow.com/questions/1566266/why-is-pythons-append-not-push which lead to a discussion from 20 years ago (1997):
https://groups.google.com/forum/#!topic/comp.lang.python/SKJq3S2ZYmg
Some key arguments from the thread:
So while it has been discussed before, it's worth bringing up again, since this was before the release of Python 2.0.
Pros:
- Would simplify the language by having a symmetric relation to pop().
- Would make it easy to use lists as stacks.
- Saves at least two characters
- If append()/insert() are being removed and replaced, the complexity of lists is slightly reduced.
Cons:
- Would blur the line between lists and stacks.
- The order of the parameters in push(obj, index = -1) would be the opposite of the parameters in insert(index, obj), because defaulted parameters come last.
- If append()/insert() are being removed and replaced, backwards compatability breaks.
- If append()/insert() are kept instead of being replaced, the complexity of lists is slightly increased.
While it isn't a necessity, I believe the benefit of push() method outweighs its cons.
~Paul