You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
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)