mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-21 16:50:02 +02:00
adds is_descriptor helper method
This commit is contained in:
parent
e69ef376ae
commit
456090fee9
@ -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__"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user