Skip to content

Releases: sigma-epsilon/sigmaepsilon.deepdict

v3.0.0

06 Dec 18:56
7a9cdf7
Compare
Choose a tag to compare

What's Changed

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 to None 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

01 Dec 22:19
3a156d3
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.2.2...v2.0.1

v1.2.2

13 Dec 09:20
6bf7c64
Compare
Choose a tag to compare
Merge pull request #36 from sigma-epsilon/snyk-fix-80d844b88968208b99…

v1.2.1: Merge pull request #29 from sigma-epsilon/28-typo-in-utilspy

01 Oct 13:43
2cfc544
Compare
Choose a tag to compare

v1.2.0

01 Oct 13:29
c54e788
Compare
Choose a tag to compare
  • Improved wrapper
  • Added ASCII printing