Features Pricing Personal Changelog Log in Start free trial
home

feeds

~lwn

bookmarks

  • [$] Improving Python's SimpleNamespace

    screenshot
    lwn.net

    Python's SimpleNamespace class provides an easy way for a programmer to create an object to store values as attributes without creating their own (almost empty) class. While it is useful (and used) in its present form, Raymond Hettinger thinks it could be better. He would like to see the hooks used by mappings (e.g. dictionaries) added to the class, so that attributes can be added and removed using either x.a or x['a']. It would bring benefits for JSON handling and more in the language.

    • Add  
    screenshot 1

Lightning-speed access to all your important links, from any device and Slack

Made with ❤ in Athens and London.

All rights reserved, Tefter 2021 ©
Find us on
  • Twitter
  • Indie Hackers
  • GitHub
  • YouTube
  • Our Blog
Get Started
  • Log in
  • Start trial
  • Explore
  • Feeds
  • Public teams
Support
  • Privacy policy
  • Terms of service
  • FAQ
  • Changelog
  • Add bookmark