Re: Using dict as object

2012-09-19 Thread Oscar Benjamin
On 2012-09-19, Pierre Tardy wrote: > --===1362296571== > Content-Type: multipart/alternative; boundary=bcaec554d3229e814204ca105e50 > > --bcaec554d3229e814204ca105e50 > Content-Type: text/plain; charset=ISO-8859-1 > >> >> This has been proposed and discussed and even implemented many

Re: Using dict as object

2012-09-19 Thread Pierre Tardy
> > This has been proposed and discussed and even implemented many > times on this list and others. > I can find this question on SO http://stackoverflow.com/questions/4984647/accessing-dict-keys-like-an-attribute-in-python which is basically answered with this solution class AttributeDict(dict):

Re: Using dict as object

2012-09-19 Thread Thomas Rachel
Am 19.09.2012 12:24 schrieb 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: b

Re: Using dict as object

2012-09-19 Thread Oscar Benjamin
On 2012-09-19, Dave Angel wrote: > On 09/19/2012 06:24 AM, Pierre Tardy wrote: >> 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! > > Assuming you're talking ab

Re: Using dict as object

2012-09-19 Thread Dave Angel
On 09/19/2012 06:24 AM, Pierre Tardy wrote: > 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. You probably need some different terminology, since a dictionary is

Using dict as object

2012-09-19 Thread 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 brd