This commit is contained in:
jxxghp
2024-09-14 13:13:11 +08:00
parent f6c84a744c
commit 57bad6353c
4 changed files with 14 additions and 7 deletions

View File

@@ -14,11 +14,18 @@ class ObjectUtils:
elif isinstance(obj, int) \
or isinstance(obj, float) \
or isinstance(obj, bool) \
or isinstance(obj, bytes):
or isinstance(obj, bytes) \
or isinstance(obj, str):
return False
else:
return str(obj).startswith("{") \
or str(obj).startswith("[")
return True
@staticmethod
def is_objstr(obj: Any):
if not isinstance(obj, str):
return False
return str(obj).startswith("{") \
or str(obj).startswith("[") \
or str(obj).startswith("(")
@staticmethod
def arguments(func: Callable) -> int: