Skip to content

Commit

Permalink
Merge pull request #14 from Vivswan/main
Browse files Browse the repository at this point in the history
v1.0.3
  • Loading branch information
Vivswan authored Jul 3, 2023
2 parents e12ab0e + c170b1d commit bdefca3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.0.3

* Moved all class variables to object variables

## 1.0.2

* Added `__deepcopy__` and more tests
Expand Down
10 changes: 6 additions & 4 deletions deduplicationdict/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ class DeDuplicationDict(MutableMapping):
Attributes:
hash_length (int): The length of the hash value used for deduplication.
auto_clean_up (bool): Whether to automatically clean up unused hash values when deleting items.
skip_update_on_setitem (bool): Whether to skip updating the value dictionary when setting an item.
key_dict (dict): A dictionary that maps hash values to their corresponding values.
value_dict (dict): A dictionary that maps values to their corresponding hash values.
"""

hash_length: int = 8
auto_clean_up: bool = True
skip_update_on_setitem: bool = True

def __init__(self, *args, _value_dict: dict = None, **kwargs):
"""Initialize a DeDuplicationDict instance.
Expand All @@ -66,6 +65,9 @@ def __init__(self, *args, _value_dict: dict = None, **kwargs):
**kwargs: Keyword arguments passed to the dict constructor.
"""

self.hash_length: int = 8
self.auto_clean_up: bool = True
self.skip_update_on_setitem: bool = True
self.key_dict: Dict[str, Union[str, DeDuplicationDict]] = {}
self.value_dict: Dict[str, Any] = {} if _value_dict is None else _value_dict

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ where = ["deduplicationdict"]
[project]
# $ pip install deduplicationdict
name = "deduplicationdict"
version = "1.0.2"
version = "1.0.3"
description = "A dictionary that de-duplicates values."
readme = "README.md"
requires-python = ">=3.7"
Expand Down

0 comments on commit bdefca3

Please sign in to comment.