Entry
list.without()? (Removing element from list)
Jul 5th, 2000 10:02
Nathan Wallace, unknown unknown, Hans Nowak, Snippet 285, Magnus L. Hetland
"""
Packages: basic_datatypes.lists
"""
"""
Whoa!
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[:]
while element in result: # changed by PSST; while <- if
result.remove(element)
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
suggestion.
"""