list.without()?

Christian Tismer tismer at appliedbiometrics.com
Tue Nov 16 15:20:23 EST 1999


"Stidolph, David" wrote:
> 
> so ...
> 
> def without(source, element):
>   while element in source:
>     source.remove(element)
> 
> Is that what you are looking for?  It would help if I had read the earlier
> posts!  :)

Semantically, yes. Proactically, I'm more keen on speed,
and i guess the single try catcher is more efficient than
to look up every thing twice. (Didn't measure it, but I'm quite sure).

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at 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




More information about the Python-list mailing list