[Python-Dev] Dict access with double-dot (syntactic sugar)

Maciej Fijalkowski fijall at gmail.com
Thu Mar 24 19:08:12 CET 2011


On Thu, Mar 24, 2011 at 11:50 AM, Guido van Rossum <guido at python.org> wrote:
> On Thu, Mar 24, 2011 at 10:37 AM, Jameson Quinn <jameson.quinn at gmail.com> wrote:
>> OK, fair enough. People don't like this. So let me back up a step.
>
>> Clearly this is intended for using with things that you get as a dictionary,
>> but which really should be namespaces. The top two cases of that are parsed
>> json objects and **kw arguments.
>
> If you need this for **kw arguments maybe you're not using them right;
> why not name your arguments if you're going to reference them by name?
>
> The JSON use case seems to be driven because this is the way
> JavaScript does things -- they don't distinguish between dicts and
> objects. I personally think that's a poor language feature: it blurs a
> line that should be clear, between data (dict keys) and program
> variables (attributes).

As an almost completely unrelated note, it also makes writing fast
interpreter for JavaScript harder, because you don't know usage
patterns, while in Python it's clear when you meant objects and when
you meant dicts.

>
> --
> --Guido van Rossum (python.org/~guido)
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/fijall%40gmail.com
>


More information about the Python-Dev mailing list