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

Christian Tismer tismer@appliedbiometrics.com
Fri, 23 Jul 1999 12:39:27 +0200


"M.-A. Lemburg" wrote:
...
> Also, has anybody considered writing list.pop(..,default) this way:
> 
> if list:
>         obj = list.pop()
> else:
>         obj = default
> 
> No exceptions, no changes, fast as hell :-)

Yes, that's the best way to go, I think.
But wasn't the primary question directed on
an atomic function which is thread-safe?
I'm not sure, this thread has grown too fast :-)

-- 
Christian Tismer             :^)   <mailto:tismer@appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101   :    *Starship* http://starship.python.net
10553 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home