xloft 0.1.12__py3-none-any.whl → 0.1.13__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.

Potentially problematic release.


This version of xloft might be problematic. Click here for more details.

xloft/namedtuple.py CHANGED
@@ -56,7 +56,8 @@ class NamedTuple:
56
56
 
57
57
  VAR_NAME_FOR_KEYS_LIST: str = "_jWjSaNy1RbtQinsN_keys"
58
58
 
59
- def __init__(self, **kwargs: dict[str, Any]) -> None: # noqa: D107
59
+ def __init__(self, **kwargs: dict[str, Any]) -> None:
60
+ """Initialize the instance."""
60
61
  vnkl = self.__class__.VAR_NAME_FOR_KEYS_LIST
61
62
  self.__dict__[vnkl] = []
62
63
  for name, value in kwargs.items():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xloft
3
- Version: 0.1.12
3
+ Version: 0.1.13
4
4
  Summary: (XLOFT) X-Library of tools
5
5
  Project-URL: Homepage, https://github.com/kebasyaty/xloft
6
6
  Project-URL: Repository, https://github.com/kebasyaty/xloft
@@ -113,11 +113,18 @@ nt.get("z") # => None
113
113
 
114
114
  d = nt.to_dict()
115
115
  d["x"] # => 10
116
- d["y"] # => "Hello"
116
+ d.get("y") # => "Hello"
117
+ d.get("z") # => None
117
118
 
118
119
  for key, val in nt.items():
119
120
  print(f"Key: {key}, Value: {val}")
120
121
 
122
+ nt.update("x", 20)
123
+ nt.update("y", "Hi")
124
+ nt.x # => 20
125
+ nt.y # => "Hi"
126
+ nt.update("z", [1, 2, 3]) # => raise: KeyError
127
+
121
128
  nt["x"] # => raise: KeyError
122
129
  nt["y"] # => raise: KeyError
123
130
  nt["z"] # => raise: KeyError
@@ -125,12 +132,6 @@ nt["x"] = 20 # => TypeError
125
132
  nt["y"] = "Hi" # => TypeError
126
133
  nt["z"] = [1, 2, 3] # => TypeError
127
134
 
128
- nt.update("x", 20)
129
- nt.update("y", "Hi")
130
- nt.x # => 20
131
- nt.y # => "Hi"
132
- nt.update("z", [1, 2, 3]) # => raise: KeyError
133
-
134
135
  nt.x = 20 # => raise: AttributeDoesNotSetValue
135
136
  nt.y = "Hi" # => raise: AttributeDoesNotSetValue
136
137
  nt.z = [1, 2, 3] # => raise: AttributeDoesNotSetValue
@@ -0,0 +1,8 @@
1
+ xloft/__init__.py,sha256=YtzkovVqW8hLxBXxM0U7K_qqfU8XBJ1pzX6tAgTUNFw,215
2
+ xloft/errors.py,sha256=GYXvi2l01VUDQSs6skiOfQsKLF6tFuUhJMqNkL7BJNI,857
3
+ xloft/namedtuple.py,sha256=t5TJ7UFX-oylUfRof8uZn-1MSuWHZk3sfDeKCEGEZFg,6758
4
+ xloft/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ xloft-0.1.13.dist-info/METADATA,sha256=5aLz9_lU6uhhYQBKJBhGInFAVivS2i_v8_KNy2Kb5kY,5868
6
+ xloft-0.1.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
+ xloft-0.1.13.dist-info/licenses/LICENSE,sha256=2zZINd6m_jNYlowdQImlEizyhSui5cBAJZRhWQURcEc,1095
8
+ xloft-0.1.13.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- xloft/__init__.py,sha256=YtzkovVqW8hLxBXxM0U7K_qqfU8XBJ1pzX6tAgTUNFw,215
2
- xloft/errors.py,sha256=GYXvi2l01VUDQSs6skiOfQsKLF6tFuUhJMqNkL7BJNI,857
3
- xloft/namedtuple.py,sha256=SFiiw_i5XyKADSZQovPyvXCixXssVM6NwwLXqPEjSwA,6732
4
- xloft/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- xloft-0.1.12.dist-info/METADATA,sha256=4k4GslVqK4_frKZIlM-lSFfgzMPM930ZkIGvqLHXUic,5843
6
- xloft-0.1.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- xloft-0.1.12.dist-info/licenses/LICENSE,sha256=2zZINd6m_jNYlowdQImlEizyhSui5cBAJZRhWQURcEc,1095
8
- xloft-0.1.12.dist-info/RECORD,,
File without changes