diff --git a/src/pydase/utils/helpers.py b/src/pydase/utils/helpers.py index 7b685ab..a1812fd 100644 --- a/src/pydase/utils/helpers.py +++ b/src/pydase/utils/helpers.py @@ -196,3 +196,7 @@ def function_has_arguments(func: Callable[..., Any]) -> bool: # Check if there are any parameters left which would indicate additional arguments. return len(parameters) > 0 + +def is_descriptor(obj): + """Check if an object is a descriptor.""" + return any(hasattr(obj, method) for method in ("__get__", "__set__", "__delete__"))