aldict 1.0.1__py3-none-any.whl → 1.0.3__py3-none-any.whl

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.
aldict/alias_dict.py CHANGED
@@ -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,11 +1,11 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: aldict
3
- Version: 1.0.1
3
+ Version: 1.0.3
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
7
7
  Keywords: multi-key dictionary,multidict,alias-dict
8
- Requires-Python: >=3.11
8
+ Requires-Python: >=3.10
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
11
  Provides-Extra: dev
@@ -13,6 +13,7 @@ Requires-Dist: pytest>=8.3.4; extra == "dev"
13
13
  Requires-Dist: ruff>=0.8.3; extra == "dev"
14
14
  Requires-Dist: build>=1.2.2; extra == "dev"
15
15
  Requires-Dist: twine>=6.0.1; extra == "dev"
16
+ Dynamic: license-file
16
17
 
17
18
  <p align="center">
18
19
  <img src="https://github.com/kaliv0/aldict/blob/main/assets/alter-ego.jpg?raw=true" width="250" alt="Alter Ego">
@@ -22,9 +23,10 @@ Requires-Dist: twine>=6.0.1; extra == "dev"
22
23
  # Aldict
23
24
 
24
25
  [![tests](https://img.shields.io/github/actions/workflow/status/kaliv0/aldict/ci.yml)](https://github.com/kaliv0/aldict/actions/workflows/ci.yml)
25
- ![Python 3.x](https://img.shields.io/badge/python-^3.11-blue?style=flat-square&logo=Python&logoColor=white)
26
+ ![Python 3.x](https://img.shields.io/badge/python-^3.10-blue?style=flat-square&logo=Python&logoColor=white)
26
27
  [![PyPI](https://img.shields.io/pypi/v/aldict.svg)](https://pypi.org/project/aldict/)
27
28
  [![License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)](https://github.com/kaliv0/aldict/blob/main/LICENSE)
29
+ [![Downloads](https://static.pepy.tech/badge/aldict)](https://pepy.tech/projects/aldict)
28
30
 
29
31
  Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values
30
32
 
@@ -86,11 +88,10 @@ ad.add_alias("y", "Yy", "xyz")
86
88
  ad.keys()
87
89
  ad.values()
88
90
  ad.items()
89
- ```
90
- ```shell
91
- dict_keys(['x', 'y', 'Xx', 'Yy', 'xyz'])
92
- dict_values([10, 20])
93
- dict_items([('x', 10), ('y', 20), ('Xx', 10), ('Yy', 20), ('xyz', 20)])
91
+
92
+ # dict_keys(['x', 'y', 'Xx', 'Yy', 'xyz'])
93
+ # dict_values([10, 20])
94
+ # dict_items([('x', 10), ('y', 20), ('Xx', 10), ('Yy', 20), ('xyz', 20)])
94
95
  ```
95
96
  - remove key and aliases
96
97
  ```python
@@ -0,0 +1,8 @@
1
+ aldict/__init__.py,sha256=0l5cJ5LuzCZhZfx-IOk2dEsq6nJQTShr6oGmufIa9i4,153
2
+ aldict/alias_dict.py,sha256=j92SVd2RN1pzrClYhxhtdRIWAZ2_eVml3P4jcK4R890,3304
3
+ aldict/exception.py,sha256=rFNmv9HuUOn2toPVYpVPQq6SOsl8nvwtJpGhPkK1puQ,83
4
+ aldict-1.0.3.dist-info/licenses/LICENSE,sha256=frOVyHZrx5o-fh5xC-kggT3MaLdp6yxV_YGpVXFHFSQ,1071
5
+ aldict-1.0.3.dist-info/METADATA,sha256=cW1pmdIJXW7AmOKgJK9HFNwcmBOwSJHJaUYCKt_ZpTQ,3486
6
+ aldict-1.0.3.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
7
+ aldict-1.0.3.dist-info/top_level.txt,sha256=pXwIKxRsbW2_Lh1HM-4cG2xE44RBzMz07GaY2EONV5M,7
8
+ aldict-1.0.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (78.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,8 +0,0 @@
1
- aldict/__init__.py,sha256=0l5cJ5LuzCZhZfx-IOk2dEsq6nJQTShr6oGmufIa9i4,153
2
- aldict/alias_dict.py,sha256=ElEw3-HqKE7vszGnPiuZ4ZJFJnak3kettz5uKqbRh20,3273
3
- aldict/exception.py,sha256=rFNmv9HuUOn2toPVYpVPQq6SOsl8nvwtJpGhPkK1puQ,83
4
- aldict-1.0.1.dist-info/LICENSE,sha256=frOVyHZrx5o-fh5xC-kggT3MaLdp6yxV_YGpVXFHFSQ,1071
5
- aldict-1.0.1.dist-info/METADATA,sha256=ZvtA-JgXEzTcJ_85CjBdr7fPCBUI3eu76Um_jV8a-yw,3381
6
- aldict-1.0.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
7
- aldict-1.0.1.dist-info/top_level.txt,sha256=pXwIKxRsbW2_Lh1HM-4cG2xE44RBzMz07GaY2EONV5M,7
8
- aldict-1.0.1.dist-info/RECORD,,