catching empty strings (I guess that's what they are)

Alex Martelli aleax at mac.com
Tue Jul 10 06:59:03 CEST 2007


Diez B. Roggisch <deets at nospam.web.de> wrote:
   ...
> for uf in user_files:
>     uf = uf.strip().lower()
>     if uf:
>        file_skip_list.append(uf)

This is fine; however, another reasonable alternative is:
    if not uf.isspace():
        file_skip_list.append(uf.strip().lower())

I prefer yours (it's simpler IMHO), but if I was doing a code review I
would accept either of these.


Alex



More information about the Python-list mailing list