Upload type_utils.py with huggingface_hub
Browse files- type_utils.py +2 -0
type_utils.py
CHANGED
|
@@ -41,6 +41,8 @@ def isoftype(object, type):
|
|
| 41 |
elif origin is tuple:
|
| 42 |
return all(isoftype(element, type_arg) for element, type_arg in zip(object, type_args))
|
| 43 |
else:
|
|
|
|
|
|
|
| 44 |
return isinstance(object, type)
|
| 45 |
|
| 46 |
|
|
|
|
| 41 |
elif origin is tuple:
|
| 42 |
return all(isoftype(element, type_arg) for element, type_arg in zip(object, type_args))
|
| 43 |
else:
|
| 44 |
+
if type == typing.Any:
|
| 45 |
+
return True
|
| 46 |
return isinstance(object, type)
|
| 47 |
|
| 48 |
|