check if var is dict

Astan Chee stanc at al.com.au
Mon Aug 13 12:01:30 CEST 2007


Hi,
I have a variable, I want to check if it is a dictionary or a string.
Is there any better way to do this than I've done. How I did it is by 
doing a .items() and catching a AttributeError that it raises if its not 
a dictionary.
How do i properly do it?
Thanks
Astan



More information about the Python-list mailing list