On Wed, 01 Feb 2012 23:19:57 -0800, Rainer Grimm wrote:

> You can do it more concise.
> 
>>>> def isListOrString(p):
> ...    return any((isinstance(p,list),isinstance(p,str)))


Or even more concisely still:

isinstance(p, (list, str))



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to