Re: [Python-Dev] Attributes access with dict

2011-03-24 Thread Eugene Toder
> My point is that I don't see the distinction between avoiding using dicts > with well-known keys and wanting to access a dict with attribute access > (which is where this started). Seems the same to me. I think using dict with well-known keys is what makes people want dict with attribute access.

Re: [Python-Dev] Attributes access with dict

2011-03-24 Thread Eric Smith
On 3/24/2011 8:10 PM, Eugene Toder wrote: Although we do something similar with namedtuple (instead of using a dict), so it's not like we have a strict distinction. Named tuple is a convenience to avoid creating boilerplate classes (or resorting to use dict with well-known keys). My point is

Re: [Python-Dev] Attributes access with dict

2011-03-24 Thread Eugene Toder
> Although we do something similar with namedtuple (instead of using a > dict), so it's not like we have a strict distinction. Named tuple is a convenience to avoid creating boilerplate classes (or resorting to use dict with well-known keys). Names in named tuple are not data, only values. In dict

Re: [Python-Dev] Attributes access with dict

2011-03-24 Thread Eric Smith
> On Thu, Mar 24, 2011 at 10:50:51AM -0700, Guido van Rossum wrote: >> The JSON use case seems to be driven because this is the way >> JavaScript does things -- they don't distinguish between dicts and >> objects. > >That's particular feature has a cure (or poison - for thos who don't > want to

Re: [Python-Dev] Attributes access with dict

2011-03-24 Thread Oleg Broytman
On Thu, Mar 24, 2011 at 10:50:51AM -0700, Guido van Rossum wrote: > The JSON use case seems to be driven because this is the way > JavaScript does things -- they don't distinguish between dicts and > objects. That's particular feature has a cure (or poison - for thos who don't want to mix getat