[Python-Dev] Dict access with double-dot (syntactic sugar)
Guido van Rossum
guido at python.org
Thu Mar 24 18:50:51 CET 2011
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).
--
--Guido van Rossum (python.org/~guido)
More information about the Python-Dev
mailing list