adds dict.pop to pydase.Client

The pop method removes the element in the dictionary on the server, but it will not
return anything. This is because pop will delete the element on the server, and returned
proxy classes will not be meaningful.
This commit is contained in:
Mose Müller 2024-04-30 13:39:38 +02:00
parent 3384d1bebf
commit 36e30970c5

View File

@ -97,6 +97,14 @@ class ProxyDict(dict[str | float, Any]):
update_value(self._sio, self._loop, full_access_path, value) update_value(self._sio, self._loop, full_access_path, value)
def pop(self, key: str) -> Any:
"""Removes the element from the dictionary on the server. It does not return
any proxy as the corresponding object on the server does not live anymore."""
full_access_path = f"{self._parent_path}.pop"
trigger_method(self._sio, self._loop, full_access_path, [key], {})
class ProxyList(list[Any]): class ProxyList(list[Any]):
def __init__( def __init__(