Raymond Hettinger wrote:
Yes, I get that.  Just want to point-out that working with heavily nested dictionaries (typical for JSON) is no fun with square brackets and quotation marks.

I can certainly agree with that sentiment, especially when working with something like GraphQL that tends to return deeply nested JSON objects. Repeatedly using [''] can get quite tiresome (and not look particularly great) with something like this:

```
for pr_edge in pr_json['data']['user']['pullRequests']['edges']:
     for comment_edge in pr_edge['node']['comments']['edges']:
          commenter = comment_edge['node']['author']['login']
          ...
```

(Extracted from a personal side-project I worked on last year)

On Wed, Apr 15, 2020 at 12:10 AM Raymond Hettinger <raymond.hettinger@gmail.com> wrote:
[GvR]
> We should not try to import JavaScript's object model into Python.

Yes, I get that.  Just want to point-out that working with heavily nested dictionaries (typical for JSON) is no fun with square brackets and quotation marks.


Raymond
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-leave@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/G5SJKRQ7S5VY3JKLAVOTCCA7RSDUNWXS/
Code of Conduct: http://python.org/psf/codeofconduct/