Magnus L. Hetland mlh at
Tue Nov 16 10:20:15 CET 1999

"Mike Fletcher" <mcfletch at> writes:

> Well...
> def without( source, element):
> 	temp = source[:]
> 	while temp:
> 		try:
> 			temp.remove( element )
> 		except:
> 			break
> 	return temp


Why on *earth* would you use a while/try/break-combination? IMO a much
more natural solution would be:

def without(source, element):
    result = source[:]
    if element in result:
    return result

My point was that I wanted a method in the standard libraries, or,
preferrably as a list method. I guess the closest I got wat the filter


  Magnus          Echelon jamming noise:
  Lie             FBI CIA NSA Handgun Assault Bomb Drug Terrorism
  Hetland         Special Forces Delta Force AK47 Hillary Clinton 

More information about the Python-list mailing list