Skip to content

Instantly share code, notes, and snippets.

@aheadley
Created May 16, 2012 15:17
Show Gist options
  • Save aheadley/2711145 to your computer and use it in GitHub Desktop.
Save aheadley/2711145 to your computer and use it in GitHub Desktop.
>>> r
(Array){
item[] =
(item){
key[] =
"code",
value[] =
1,
},
(item){
key[] =
"payload",
value[] = <empty>
},
(item){
key[] =
"message",
value[] =
"Authentication Error",
},
}
>>> dict((i.key[0], i.value[0],) for i in r.item)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "<input>", line 1, in <genexpr>
IndexError: list index out of range
>>> r.item[0].key[0]
code
>>> r.item[0].value[0]
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment