How to tell the difference between string and list

Jan Kokoska kokoska.jan at globe.cz
Fri Dec 5 10:03:24 EST 2003


Hello Skip,

>     if isinstance(a, str):
>         pass
>     elif isinstance(a, list):
>         pass
> 

Tnx, worked like a charm (I would bet isinstance() 
uses __class__ internally, my bad).

The time for me to read libref, probably ;)

-Jan






More information about the Python-list mailing list