A
adam carr
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.
What is the cleanest way to iterate over the return value of this function?
Or would it be better to fix the get_items() function itself to always
return lists no matter what?
Thanks,
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.
What is the cleanest way to iterate over the return value of this function?
Or would it be better to fix the get_items() function itself to always
return lists no matter what?
Thanks,