mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-21 00:40:01 +02:00
properly binding task method
This commit is contained in:
parent
3cd7198747
commit
2a1aff589d
@ -102,12 +102,6 @@ class Task(pydase.DataService, Generic[R]):
|
|||||||
def __get__(self, instance: Any, owner: Any) -> Self:
|
def __get__(self, instance: Any, owner: Any) -> Self:
|
||||||
# need to use this descriptor to bind the function to the instance of the class
|
# need to use this descriptor to bind the function to the instance of the class
|
||||||
# containing the function
|
# containing the function
|
||||||
if instance and self._bound_func is not None:
|
if instance and self._bound_func is None:
|
||||||
|
self._bound_func = self._func.__get__(instance, owner)
|
||||||
async def bound_func() -> R | None:
|
|
||||||
if not is_bound_method(self._func):
|
|
||||||
return await self._func(instance)
|
|
||||||
return None
|
|
||||||
|
|
||||||
self._bound_func = bound_func
|
|
||||||
return self
|
return self
|
||||||
|
Loading…
x
Reference in New Issue
Block a user