Please pardon me for breaking threading, but Stef's original post has not come through to me.
On 6/30/10 11:39 AM, Stef Mientki wrote: > hello, > > I've lot of functions that returns their result in some kind of tuple / > list / array, > and if there is no result, these functions return None. Well there's your problem right there. If you have a function that returns a list of X, and there are no X to return, you should return an empty list, not None. >>> filter(lambda n: n%2 == 0, [1, 3, 5, 7]) # return even numbers [] There are good use-cases for functions that sometimes return X and sometimes return None, but they're rare. -- Steven -- http://mail.python.org/mailman/listinfo/python-list