Typeerror: Isinstance() Arg 2 Must Be A Type Or Tuple Of Types >>>
>>> names=['jill','jack'] >>> isinstance(names,list) Traceback (most recent call last): File '', line 1, in isinstance(nam
Solution 1:
You've stomped on list
by assigning to a local variable of the same name. Don't do that.
Solution 2:
Apply this one :
ifisinstance(names, type(list)):
Solution 3:
But this works in Python (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit (Intel)] on win32:
>>>names=['jill', 'jack']>>>isinstance(names, list)
True
Solution 4:
This can also happen if you've accidentally messed up the foreign key field syntax in your model. When writing a foreign key field, you can have:
ModelName
or:
'app_name.ModelName'
but you cannot have:
'ModelName'
Learnt that one the hard way.
Post a Comment for "Typeerror: Isinstance() Arg 2 Must Be A Type Or Tuple Of Types >>>"