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

Jim Fulton jim@digicool.com
Thu, 22 Jul 1999 16:55:05 -0400

"Barry A. Warsaw" wrote:
> >>>>> "M" == M  <mal@lemburg.com> writes:
>     M>  http://www.deja.com/getdoc.xp?AN=366635977
> Ah, thanks!  Your rationale was exactly the reason why I added
> dict.get().  I'm still not 100% sure about list.pop() though, since
> it's not exactly equivalent -- list.pop() modifies the list as a
> side-effect :) Makes me think you might want an alternative spelling
> for list[s], call it list.get() and put the optional default on that
> method.  Then again, maybe list.pop() with an optional default is good
> enough.

list.get and list.pop are different, since get wouldn't modify the list
and pop would.


Jim Fulton           mailto:jim@digicool.com   Python Powered!        
Technical Director   (888) 344-4332            http://www.python.org  
Digital Creations    http://www.digicool.com   http://www.zope.org    

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for