➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients rhettinger
Date 2020-04-14.21:10:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
types.SimpleNamespace() would be much more usable if it were more substitutable for dictionaries.   In particular, it would be wonderful to be able to use object_hook=SimpleNamespace in json.load():

Current:

     catalog = json.load(f)
     print(catalog['clothing']['mens']['shoes']['extra_wide']['quantity'])

Proposed:

     catalog = json.load(f, object_hook=SimpleNamespace)
     print(catalog.clothing.mens.shoes.extra_wide.quantity])
History
Date User Action Args
2020-04-14 21:10:49rhettingersetrecipients: + rhettinger
2020-04-14 21:10:49rhettingersetmessageid: <[email protected]>
2020-04-14 21:10:49rhettingerlinkissue40284 messages
2020-04-14 21:10:48rhettingercreate