xloft 0.1.11__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
@@ -1,6 +1,5 @@
1
- """NamedTuple.
1
+ """This module contains the implementation of the `NamedTuple` class.
2
2
 
3
- This module contains the implementation of the `NamedTuple` class.
4
3
  `NamedTuple` class imitates the behavior of the _named tuple_.
5
4
 
6
5
  Examples:
@@ -57,7 +56,8 @@ class NamedTuple:
57
56
 
58
57
  VAR_NAME_FOR_KEYS_LIST: str = "_jWjSaNy1RbtQinsN_keys"
59
58
 
60
- def __init__(self, **kwargs: dict[str, Any]) -> None: # noqa: D107
59
+ def __init__(self, **kwargs: dict[str, Any]) -> None:
60
+ """Initialize the instance."""
61
61
  vnkl = self.__class__.VAR_NAME_FOR_KEYS_LIST
62
62
  self.__dict__[vnkl] = []
63
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.11
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
@@ -11,7 +11,7 @@ Author-email: kebasyaty <kebasyaty@gmail.com>
11
11
  License-Expression: MIT
12
12
  License-File: LICENSE
13
13
  Keywords: collection,namedtuple,tools,xloft
14
- Classifier: Development Status :: 4 - Beta
14
+ Classifier: Development Status :: 5 - Production/Stable
15
15
  Classifier: Intended Audience :: Developers
16
16
  Classifier: License :: OSI Approved :: MIT License
17
17
  Classifier: Operating System :: MacOS :: MacOS X
@@ -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
@@ -145,4 +146,4 @@ del nt.y # => raise: AttributeCannotBeDelete
145
146
 
146
147
  ## License
147
148
 
148
- **This project is licensed under the** [MIT](https://github.com/kebasyaty/xloft/blob/main/LICENSE "MIT")**.**
149
+ This project is licensed under the **[MIT](https://github.com/kebasyaty/xloft/blob/main/LICENSE "MIT")**.
@@ -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=NT98kIuVoPf6LHHVaPAnveK9KdeBjxGlO_AZtpCnkWM,6745
4
- xloft/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- xloft-0.1.11.dist-info/METADATA,sha256=NAuMTBKl9QAEiTEv7WHzxl7wPASqLDYn_P5YSjHVhDg,5834
6
- xloft-0.1.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- xloft-0.1.11.dist-info/licenses/LICENSE,sha256=2zZINd6m_jNYlowdQImlEizyhSui5cBAJZRhWQURcEc,1095
8
- xloft-0.1.11.dist-info/RECORD,,
File without changes