You should try using isinstance()
if isinstance(object, list):
In your case
if isinstance(tmpDict[key], list):
Develop:
x = [1,2,3] if type(x) == list(): print "This wont work" if type(x) == list: ## one of the way to see if it list print "this will work" if type(x) == type(list()): print "lets see if this works" if isinstance(x, list): ## most preferred way to check if it list print "This should work just fine"
source share