Fixed children retrieving from python collections by javascript.
I've stuck with a problem recently with python collections and accessing them from javascript.
Say you have a JSON object (python dict)
{
"a": 5,
"b": 10,
"items": [1, 2, 3]
}
When you pass it to javascript, it has a problem accessing some fields from it. For example, if you would like to print whole python dict from javascript, it prints OK, but if you try to access some childs, corresponding methods may be returned instead.
For example, dict has a method items. So if you try to access dict["items"] from javascript, you will end up with a reference to such method, instead of child with name "items".
This pull request reverses the order of querying items from python object: first, if the object is a python collection, it tries to pull that item. Then, a corresponding field is tried to be pulled.
I understand that there would be no way to access function dict.items from now on, if there's a child with such name. But this problem only occurs to python collections, and this method is kinda useless since for (var i in dict) gives what you want. Also, printing whole dict returns childs instead of methods, so return [1, 2, 3] instead of [Function function] should be kinda expected result.
@flier the patch is ok for me but a comment from you would be appreciated before merging. Thanks!