>I think the first place to start would be to either set a default argument for "insert"
>or add an optional argument for "append", but in both cases that would again be
>duplicating functionality so I don't see the point.
- Todd
That would be fine too; the main idea is just having a method that's symmetrically related to pop(). append(2, 2) would seem awkward, but it could work with insert(2).
-Nick Coghlan
This is an interesting argument, because English isn't my first language, so it's not something I would think of. Having a programming language obey the laws of spoken English seems uncalled for, but it's still a good point. The name could be something more natural, of course. (Even so, is "pop() an item from a list" any better?)
>There is absolutely zero chance that append and insert are going away. That would break everything.
- Todd
>There's zero chance of the existing APIs going away
- Nick Coghlan
It was hypothetical, but you're probably right.
>I don't think it makes sense to add the method
- Nick Coghlan
It makes sense to have inverse methods. pop() pops off the last item and pop(i) pops off the ith item. There are no methods such that push(obj) pushes the item onto the end and push(obj, index) pushes the item onto the ith position. That would be append(obj) and insert(obj, index), but there's no symmetric relation here. This is harder to learn, so it would be better to have a unified method for the inverse. Todd's suggestion of letting the index parameter for insert() be optional would accomplish the same result, without having to add an additional method.
~Paul