aldict 1.0.1__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aldict
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values
5
5
  Author-email: Kaloyan Ivanov <kaloyan.ivanov88@gmail.com>
6
6
  Project-URL: repository, https://github.com/kaliv0/aldict
@@ -25,6 +25,7 @@ Requires-Dist: twine>=6.0.1; extra == "dev"
25
25
  ![Python 3.x](https://img.shields.io/badge/python-^3.11-blue?style=flat-square&logo=Python&logoColor=white)
26
26
  [![PyPI](https://img.shields.io/pypi/v/aldict.svg)](https://pypi.org/project/aldict/)
27
27
  [![License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)](https://github.com/kaliv0/aldict/blob/main/LICENSE)
28
+ [![Downloads](https://static.pepy.tech/badge/aldict)](https://pepy.tech/projects/aldict)
28
29
 
29
30
  Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values
30
31
 
@@ -9,6 +9,7 @@
9
9
  ![Python 3.x](https://img.shields.io/badge/python-^3.11-blue?style=flat-square&logo=Python&logoColor=white)
10
10
  [![PyPI](https://img.shields.io/pypi/v/aldict.svg)](https://pypi.org/project/aldict/)
11
11
  [![License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)](https://github.com/kaliv0/aldict/blob/main/LICENSE)
12
+ [![Downloads](https://static.pepy.tech/badge/aldict)](https://pepy.tech/projects/aldict)
12
13
 
13
14
  Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values
14
15
 
@@ -81,10 +81,10 @@ class AliasDict(UserDict):
81
81
  def __delitem__(self, key):
82
82
  try:
83
83
  self.data.__delitem__(key)
84
+ self._alias_dict = {k: v for k, v in self._alias_dict.items() if v != key}
84
85
  except KeyError:
85
- # in case we try to delete alias e.g. via pop()
86
- pass
87
- self._alias_dict = {k: v for k, v in self._alias_dict.items() if v != key}
86
+ # in case we try to delete alias via pop() or del
87
+ return self.remove_alias(key)
88
88
 
89
89
  def __contains__(self, item):
90
90
  return item in set(self.keys())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aldict
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values
5
5
  Author-email: Kaloyan Ivanov <kaloyan.ivanov88@gmail.com>
6
6
  Project-URL: repository, https://github.com/kaliv0/aldict
@@ -25,6 +25,7 @@ Requires-Dist: twine>=6.0.1; extra == "dev"
25
25
  ![Python 3.x](https://img.shields.io/badge/python-^3.11-blue?style=flat-square&logo=Python&logoColor=white)
26
26
  [![PyPI](https://img.shields.io/pypi/v/aldict.svg)](https://pypi.org/project/aldict/)
27
27
  [![License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)](https://github.com/kaliv0/aldict/blob/main/LICENSE)
28
+ [![Downloads](https://static.pepy.tech/badge/aldict)](https://pepy.tech/projects/aldict)
28
29
 
29
30
  Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values
30
31
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aldict"
7
- version = "1.0.1"
7
+ version = "1.0.2"
8
8
  readme = "README.md"
9
9
  authors = [{ name = "Kaloyan Ivanov", email = "kaloyan.ivanov88@gmail.com" }]
10
10
  description = "Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values"
@@ -142,7 +142,7 @@ def test_pop_alias_doesnt_remove_key(alias_dict):
142
142
  "import_mod": "yaml",
143
143
  "read_mode": "r",
144
144
  }
145
- assert ".yaml" in alias_dict
145
+ assert list(alias_dict.keys()) == [".json", ".yaml", ".toml"]
146
146
 
147
147
 
148
148
  def test_iter(alias_dict):
File without changes
File without changes
File without changes
File without changes