Cameron Simpson wrote: > if s is not None and len(s) > 0: > ... do something with the non-empty string `s` ... > > In this example, None is a sentinel value for "no valid string" and > calling "len(s)" would raise an exception because None doesn't have > a length.
obviously in this case an `if s: ...` is more than sufficient :P -- ZeD -- http://mail.python.org/mailman/listinfo/python-list