On Jan 14, 1:53 pm, "bruce" <bedoug...@earthlink.net> wrote: > Hi... > > i have the test dict/list > a= {"a": 'a1',"b" : "b1"} > b= [{"a": 'a1',"b" : "b1"}] > > i'm trying to figure out how to programtically tell them apart... > > ie, which is a dict, and which is a list...
>>> a = {"a": 'a1', "b": "b1"} >>> b = [{"a": 'a1', "b": "b1"}] >>> isinstance(a, list) False >>> isinstance(b, list) True >>> isinstance(a, dict) True >>> isinstance(b, dict) False >>> type(a) <type 'dict'> >>> type(b) <type 'list'> >>> -- http://mail.python.org/mailman/listinfo/python-list