> Else, you could as well write your own testing function:
>
> def str_starts_with(astring, *prefixes):
>    startswith = astring.startswith
>    for prefix in prefixes:
>      if startswith(prefix):
>        return true
>    return false
>

What is the reason for
  startswith = astring.startswith
  startswith(prefix)

instead of
  astring.startswith(prefix)

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to