[Python-Dev] I'd like list.pop to accept an optional second

Skip Montanaro skip@mojam.com (Skip Montanaro)
Fri, 23 Jul 1999 11:23:31 -0500 (CDT)


    Fred> Giving up already?  Wouldn't you just love this as an expression
    Fred> operator (which could work)?
    Fred>   How about:

    Fred>       top = list.pop() excepting IndexError, default

Why not go all the way to Perl with

    top = list.pop() unless IndexError

???

;-)

Skip