Releases: sigma-epsilon/sigmaepsilon.deepdict
v3.0.0
What's Changed
- Dev by @BALOGHBence in #53
Full Changelog: v2.0.1...v3.0.0
Added
- Added type checks for the magic methods
__getitem__
,__setitem__
and__delitem__
. - Added a custom exception type
DeepDictLockedError
for when a locked dictionary is about to be modified. - Added new special methods
__before_join_parent__
,__after_join_parent__
,__before_leave_parent__
and__after_leave_parent__
to replace the hooks__leave_parent__
and__join_parent__
.
Changed
-
The behaviour when assigning a
None
value to a key has been changed:from sigmaepsilon.deepdict import DeepDict dd = DeepDict() dd["key"] = "value" dd["key"] = None
Previously, this would delete the key from the dictionary, which was inconsistent with the behavior of the built-in
dict
class. Starting from this version, the last line will only set the value toNone
without deleting the key. To delete the key, you should now use:del dd["key"]
-
Customizing the behaviour upon deleting a DeepDict from its parent and adding a child DeepDict has been changed, see the notes at the 'Deprecated' section.
-
Changed the locking behaviour to cover for all scenarios that would modify the layout of a dictionary. The previous implementation only covered creating new keys, but it didn't protect agains deletions.
Deprecated
The use of the hooks __leave_parent__
and __join_parent__
is deprecated. They are replaced with __before_join_parent__
, __after_join_parent__
, __before_leave_parent__
and __after_leave_parent__
, which provides more fine grained control. See the documentation for more details.
Refactored
Refactored the implementations of magic methods __setitem__
, __getitem__
and __delitem__
for better clarity and improved code quality.
2.0.1
What's Changed
- updated config files by @BALOGHBence in #38
- Test by @BALOGHBence in #39
- Dev by @BALOGHBence in #44
- Dev by @BALOGHBence in #48
Full Changelog: v1.2.2...v2.0.1
v1.2.2
Merge pull request #36 from sigma-epsilon/snyk-fix-80d844b88968208b99…
v1.2.1: Merge pull request #29 from sigma-epsilon/28-typo-in-utilspy
Fixed a typo that resulted in a NameError
v1.2.0
- Improved wrapper
- Added ASCII printing