How to determine an object is "scriptable"
larry.bates at websafe.com
Thu Mar 30 16:20:53 CEST 2006
> I recently came across a problem where I saw this error:
> "TypeError: unsubscriptable object"
> How can I determine if an object is "scriptable" or "unscriptable"?
Simplest answer is to use isinstance to see if it is a string, list,
if isinstance(variable, (str, list, tuple)):
Now the problem is that this answer doesn't address the problem.
Your code is attempting to do something to the wrong type of
object/variable which is a logic problem.
More information about the Python-list