osbot-utils 2.25.0__py3-none-any.whl → 2.26.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.
@@ -166,12 +166,16 @@ class Type_Safe__Validation:
166
166
  if type(value) is list:
167
167
  return True # if the attribute is a set and the value is a list, then they are compatible
168
168
  if origin_attr_type is type: # Add handling for Type[T]
169
- type_arg = get_args(attr_type)[0] # Get T from Type[T]
170
- if type_arg == value:
171
- return True
172
- if isinstance(type_arg, (str, ForwardRef)): # Handle forward reference
173
- type_arg = target.__class__ # If it's a forward reference, the target class should be the containing class
174
- return isinstance(value, type) and issubclass(value, type_arg) # Check that value is a type and is subclass of type_arg
169
+ type_args = get_args(attr_type)
170
+ if type_args:
171
+ type_arg = get_args(attr_type)[0] # Get T from Type[T]
172
+ if type_arg == value:
173
+ return True
174
+ if isinstance(type_arg, (str, ForwardRef)): # Handle forward reference
175
+ type_arg = target.__class__ # If it's a forward reference, the target class should be the containing class
176
+ return isinstance(value, type) and issubclass(value, type_arg) # Check that value is a type and is subclass of type_arg
177
+ else:
178
+ return isinstance(value, type)
175
179
 
176
180
  if origin_attr_type is Annotated: # if the type is Annotated
177
181
  args = get_args(attr_type)
osbot_utils/version CHANGED
@@ -1 +1 @@
1
- v2.25.0
1
+ v2.26.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: osbot_utils
3
- Version: 2.25.0
3
+ Version: 2.26.0
4
4
  Summary: OWASP Security Bot - Utils
5
5
  License: MIT
6
6
  Author: Dinis Cruz
@@ -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-v2.25.0-blue)
26
+ ![Current Release](https://img.shields.io/badge/release-v2.26.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
 
@@ -314,7 +314,7 @@ osbot_utils/type_safe/shared/Type_Safe__Json_Compressor__Type_Registry.py,sha256
314
314
  osbot_utils/type_safe/shared/Type_Safe__Not_Cached.py,sha256=25FAl6SOLxdStco_rm9tgOYLfuKyBWheGdl7vVa56UU,800
315
315
  osbot_utils/type_safe/shared/Type_Safe__Raise_Exception.py,sha256=pbru8k8CTQMNUfmFBndiJhg2KkqEYzFvJAPcNZHeHfQ,829
316
316
  osbot_utils/type_safe/shared/Type_Safe__Shared__Variables.py,sha256=SuZGl9LryQX6IpOE0I_lbzClT-h17UNylC__-M8ltTY,129
317
- osbot_utils/type_safe/shared/Type_Safe__Validation.py,sha256=5dVs2zDU_sDh3e025KjaDfUS7B8XENlQ77-7U34b2KY,19017
317
+ osbot_utils/type_safe/shared/Type_Safe__Validation.py,sha256=1oamgApW2Pug0vvTqMLPxBLFvtcnp1bFnjSUByfJBrs,19192
318
318
  osbot_utils/type_safe/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
319
319
  osbot_utils/type_safe/steps/Type_Safe__Step__Class_Kwargs.py,sha256=snoyJKvZ1crgF2fp0zexwNPnV_E63RfyRIsMAZdrKNY,6995
320
320
  osbot_utils/type_safe/steps/Type_Safe__Step__Default_Kwargs.py,sha256=tzKXDUc0HVP5QvCWsmcPuuZodNvQZ9FeMDNI2x00Ngw,1943
@@ -355,8 +355,8 @@ osbot_utils/utils/Toml.py,sha256=Rxl8gx7mni5CvBAK-Ai02EKw-GwtJdd3yeHT2kMloik,166
355
355
  osbot_utils/utils/Version.py,sha256=Ww6ChwTxqp1QAcxOnztkTicShlcx6fbNsWX5xausHrg,422
356
356
  osbot_utils/utils/Zip.py,sha256=pR6sKliUY0KZXmqNzKY2frfW-YVQEVbLKiyqQX_lc-8,14052
357
357
  osbot_utils/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
358
- osbot_utils/version,sha256=YRrwGZV28BEbDaCZluIJal-r_2KcdgEPqt2yovhN6yM,8
359
- osbot_utils-2.25.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
360
- osbot_utils-2.25.0.dist-info/METADATA,sha256=T868rW36OicA_mo2WOIjA2R65ke3hK2QO4yBsiICzps,1329
361
- osbot_utils-2.25.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
362
- osbot_utils-2.25.0.dist-info/RECORD,,
358
+ osbot_utils/version,sha256=RZSaVXviZF3y9UfjXr3YrDmllry-euUcFHCuLsyhkPU,8
359
+ osbot_utils-2.26.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
360
+ osbot_utils-2.26.0.dist-info/METADATA,sha256=mfZ8WcLMiykJ8Sn7KstCiYQmPEw1JCGByBinJ1SQXAU,1329
361
+ osbot_utils-2.26.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
362
+ osbot_utils-2.26.0.dist-info/RECORD,,