osbot-utils 1.79.0__py3-none-any.whl → 1.80.0__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.
@@ -293,15 +293,17 @@ class Type_Safe:
293
293
  value = self.deserialize_dict__using_key_value_annotations(key, value)
294
294
  elif obj_is_attribute_annotation_of_type(self, key, list): # handle the case when the value is a list
295
295
  attribute_annotation = obj_attribute_annotation(self, key) # get the annotation for this variable
296
- expected_type = get_args(attribute_annotation)[0] # get the first arg (which is the type)
297
- type_safe_list = Type_Safe__List(expected_type) # create a new instance of Type_Safe__List
298
- for item in value: # next we need to convert all items (to make sure they all match the type)
299
- if type(item) is dict:
300
- new_item = expected_type(**item) # create new object
301
- else:
302
- new_item = expected_type(item)
303
- type_safe_list.append(new_item) # and add it to the new type_safe_list obejct
304
- value = type_safe_list # todo: refactor out this create list code, maybe to an deserialize_from_list method
296
+ attribute_annotation_args = get_args(attribute_annotation)
297
+ if attribute_annotation_args:
298
+ expected_type = get_args(attribute_annotation)[0] # get the first arg (which is the type)
299
+ type_safe_list = Type_Safe__List(expected_type) # create a new instance of Type_Safe__List
300
+ for item in value: # next we need to convert all items (to make sure they all match the type)
301
+ if type(item) is dict:
302
+ new_item = expected_type(**item) # create new object
303
+ else:
304
+ new_item = expected_type(item)
305
+ type_safe_list.append(new_item) # and add it to the new type_safe_list obejct
306
+ value = type_safe_list # todo: refactor out this create list code, maybe to an deserialize_from_list method
305
307
  else:
306
308
  if value is not None:
307
309
  if obj_is_attribute_annotation_of_type(self, key, EnumMeta): # Handle the case when the value is an Enum
osbot_utils/version CHANGED
@@ -1 +1 @@
1
- v1.79.0
1
+ v1.80.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: osbot_utils
3
- Version: 1.79.0
3
+ Version: 1.80.0
4
4
  Summary: OWASP Security Bot - Utils
5
5
  Home-page: https://github.com/owasp-sbot/OSBot-Utils
6
6
  License: MIT
@@ -23,7 +23,7 @@ Description-Content-Type: text/markdown
23
23
 
24
24
  Powerful Python util methods and classes that simplify common apis and tasks.
25
25
 
26
- ![Current Release](https://img.shields.io/badge/release-v1.79.0-blue)
26
+ ![Current Release](https://img.shields.io/badge/release-v1.80.0-blue)
27
27
  [![codecov](https://codecov.io/gh/owasp-sbot/OSBot-Utils/graph/badge.svg?token=GNVW0COX1N)](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
28
28
 
29
29
 
@@ -2,7 +2,7 @@ osbot_utils/__init__.py,sha256=DdJDmQc9zbQUlPVyTJOww6Ixrn9n4bD3ami5ItQfzJI,16
2
2
  osbot_utils/base_classes/Cache_Pickle.py,sha256=kPCwrgUbf_dEdxUz7vW1GuvIPwlNXxuRhb-H3AbSpII,5884
3
3
  osbot_utils/base_classes/Kwargs_To_Disk.py,sha256=HHoy05NC_w35WcT-OnSKoSIV_cLqaU9rdjH0_KNTM0E,1096
4
4
  osbot_utils/base_classes/Kwargs_To_Self.py,sha256=weFNsBfBNV9W_qBkN-IdBD4yYcJV_zgTxBRO-ZlcPS4,141
5
- osbot_utils/base_classes/Type_Safe.py,sha256=0vWJxiSmdvYsObvC5g7x9WKw9fxWX5HxaqSBzYHqz_o,22162
5
+ osbot_utils/base_classes/Type_Safe.py,sha256=lAWsPoNGoLIrzjJ5xIHP_rlpTmeTP0eXbvnBKGEB1s0,22335
6
6
  osbot_utils/base_classes/Type_Safe__List.py,sha256=iWyoc2xjHkTJrZTVnPse9Rljte2tF67oNq8yA7jnAhY,5996
7
7
  osbot_utils/base_classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  osbot_utils/context_managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -306,8 +306,8 @@ osbot_utils/utils/Toml.py,sha256=-_Yv5T8ZhGGoDSSoNEdFhSsXiK_JPjGkPijm4JoeHSk,166
306
306
  osbot_utils/utils/Version.py,sha256=Ww6ChwTxqp1QAcxOnztkTicShlcx6fbNsWX5xausHrg,422
307
307
  osbot_utils/utils/Zip.py,sha256=pR6sKliUY0KZXmqNzKY2frfW-YVQEVbLKiyqQX_lc-8,14052
308
308
  osbot_utils/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
309
- osbot_utils/version,sha256=KEX29UC5Uv4spaDDhd-0Bj5jml_-imp7G10GtUMWRKE,8
310
- osbot_utils-1.79.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
311
- osbot_utils-1.79.0.dist-info/METADATA,sha256=W1Ns67ldm-I-vB9_slES-zAuMZ-N1q21vtr9oxDPNSU,1317
312
- osbot_utils-1.79.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
313
- osbot_utils-1.79.0.dist-info/RECORD,,
309
+ osbot_utils/version,sha256=kZW8YcxtUgv8JJ5SMq_RAgJKr-SRwTryyrVMJjtd39o,8
310
+ osbot_utils-1.80.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
311
+ osbot_utils-1.80.0.dist-info/METADATA,sha256=GIgAeq1697iuS-tNNl4zTwOz4xA3-GzE2cX__pZc0fg,1317
312
+ osbot_utils-1.80.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
313
+ osbot_utils-1.80.0.dist-info/RECORD,,