On Nov 27, 8:57 am, Roy Smith <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > "adam carr" <[EMAIL PROTECTED]> wrote: > > > I call a function get_items() which returns a list of items. > > However, in some cases, it returns just one item. > > It returns the item as an object though, not as a list containing one > > object. > > In other cases it simply returns None. > > Almost certainly what you need to do is change the function to always > return a list. Might be a list of one object. Might be an empty list. > But always a list. Keep the interface simple and obvious and you avoid > complexities such as the one you're facing now.
see this wiki for better understanding of Roy's suggestion...words to live by my friend =D http://en.wikipedia.org/wiki/KISS_principle -- http://mail.python.org/mailman/listinfo/python-list