Skip to content

Version 8.1.0

Latest

Choose a tag to compare

@cdgriffith cdgriffith released this 04 Dec 05:11
faddb38

Changes

  • Adding #147 StrictBox to reject new fields in attribute assignments while allowing explicit dictionary updates (thanks to Nash Aschenbath)

Behavior changes

  • Box.get(key, default) with a dict or list default now builds it with the Box's own options and box_class, as setdefault() already did, instead of a plain Box or BoxList. For example a default from a Box with box_dots, default_box or camel_killer_box now uses those options, a Box subclass returns its own class, and a default from a frozen Box is now frozen. The default is still not stored in the Box (thanks to Enes Kartal)
  • Fixing #366 update() and merge_update() (also for ConfigBox) testing the truth value of their argument before reading it: iterables without a truth value, such as a NumPy array of key / value pairs, are now read instead of raising, and a non-empty mapping whose __bool__ returns False is now read instead of skipped. Only None (or no argument) is skipped now, so a falsy argument that is not iterable, such as 0 or False, now raises TypeError like dict.update does, previously it was ignored (thanks to Yash Dhankhar)