Article 52TRC [$] Improving Python's SimpleNamespace

[$] Improving Python's SimpleNamespace

by
jake
from LWN.net on (#52TRC)
Python's SimpleNamespace classprovides an easy way for a programmer to create an object to store valuesas attributes without creating their own (almost empty) class. While it isuseful (and used) in its present form, Raymond Hettinger thinks it couldbe better. He would like to see the hooks used by mappings(e.g. dictionaries) added to the class, so that attributes can be added andremoved using either x.a or x['a']. It would bringbenefits for JSON handling and more in the language.
External Content
Source RSS or Atom Feed
Feed Location http://lwn.net/headlines/rss
Feed Title LWN.net
Feed Link https://lwn.net/
Reply 0 comments