P
Pierre Tardy
One thing that is cooler with java-script than in python is that dictionaries and objects are the same thing. It allows browsing of complex hierarchical data syntactically easy.
For manipulating complex jsonable data, one will always prefer writing:
buildrequest.properties.myprop
rather than
brdict['properties']['myprop']
This ability in JS is well known for its flaws (e.g. http://drupal.org/node/172169#forin ), and I understand why this is not a feature that we want inpython by default. I did work on class that adds this feature, and that I wish to use for manipulating my json data.
The following github pull request to buildbot has tests that defines specification of such a class, and has several commits, which gives several implementation of the same thing.
https://github.com/buildbot/buildbot/pull/525
All implementation I tried are much slower than a pure native dict access.
Each implementation have bench results in commit comment. All of them are 20+x slower than plain dict!
I would like to have python guys advices on how one could optimize this.
I'd like to eventually post this to python-dev, please tell if this is really not a good idea.
Regards,
Pierre
For manipulating complex jsonable data, one will always prefer writing:
buildrequest.properties.myprop
rather than
brdict['properties']['myprop']
This ability in JS is well known for its flaws (e.g. http://drupal.org/node/172169#forin ), and I understand why this is not a feature that we want inpython by default. I did work on class that adds this feature, and that I wish to use for manipulating my json data.
The following github pull request to buildbot has tests that defines specification of such a class, and has several commits, which gives several implementation of the same thing.
https://github.com/buildbot/buildbot/pull/525
All implementation I tried are much slower than a pure native dict access.
Each implementation have bench results in commit comment. All of them are 20+x slower than plain dict!
I would like to have python guys advices on how one could optimize this.
I'd like to eventually post this to python-dev, please tell if this is really not a good idea.
Regards,
Pierre