[Python-Dev] Re: Improvement to SimpleNamespace

2020年4月15日 08:02:27 -0700

On 2020年4月15日 at 15:41, Brett Cannon <[email protected]> wrote:
>
> The "hey I'm a dict, but look over hear and now you can treat my like like 
> any other object" duality doesn't sit well with me. I do understand the idea 
> of wanting to convert something to convert JSON data into a more object-like 
> access pattern, though.
I don't like the duality, but I *do* like (in some situations) the
object-with-dynamic-attributes style of access. Basically, when access
is predominantly via literal strings and heavily nested,
 obj["element"]["sub"]["another"]
is *far* more punctuation-heavy and (IMO) difficult to read as a
consequence, than
 obj.element.sub.another
Paul
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/RZQG5BIY4KJA5NIONSXOY4OG26ALZ57G/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to