> result = myfunction (vars) > > if not result: > # error condition > > Now above I first realized that the function can also return an empty > list under some conditions and so changed it to
If your function returns a list when successful, it should not return False in the error case. Instead, it should return None (indicating that there is no list). Then the condition changes to result = myfunction() if result is None: # error condition Using None for "no result available" is very common in Python. Using False for the same purpose (i.e. returning either a list or False) is not. If you return False from a function, the only other possible result should be True. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list