John Reese wrote:
> I now do:
>  
>   if isinstance(x, list):
>  
> It is my understanding that this is what people do nowadays.

I wouldn't go that far.  I don't have an isinstance check for lists 
anywhere in my entire codebase.  Why do you think you need to check to 
see if something is of type list?  Why don't you just use it as needed, 
and find out, e.g.:

try:
     itr = iter(x)
except TypeError:
     # do whatever you need to do if it's not iterable
else:
     # do whatever you need to do if it *is* iterable

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

Reply via email to