From 88a630518b787922f8d0f01a7562fa0a45aae7e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Tue, 30 Apr 2024 15:41:14 +0200 Subject: [PATCH] updates ProxyDict types, ignores mypy error --- src/pydase/client/proxy_loader.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pydase/client/proxy_loader.py b/src/pydase/client/proxy_loader.py index 08137cd..29a26df 100644 --- a/src/pydase/client/proxy_loader.py +++ b/src/pydase/client/proxy_loader.py @@ -75,10 +75,10 @@ def update_value( ) -class ProxyDict(dict[str | float, Any]): +class ProxyDict(dict[str, Any]): def __init__( self, - original_dict: dict[str | float, Any], + original_dict: dict[str, Any], parent_path: str, sio_client: socketio.AsyncClient, loop: asyncio.AbstractEventLoop, @@ -88,7 +88,7 @@ class ProxyDict(dict[str | float, Any]): self._loop = loop self._sio = sio_client - def __setitem__(self, key: str | float, value: Any) -> None: + def __setitem__(self, key: str, value: Any) -> None: observer_key = key if isinstance(key, str): observer_key = f'"{key}"' @@ -97,7 +97,7 @@ class ProxyDict(dict[str | float, Any]): update_value(self._sio, self._loop, full_access_path, value) - def pop(self, key: str) -> Any: + def pop(self, key: str) -> Any: # type: ignore """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.""" @@ -301,7 +301,7 @@ class ProxyLoader: { key: ProxyLoader.loads_proxy(value, sio_client, loop) for key, value in cast( - dict[str | float, SerializedObject], serialized_object["value"] + dict[str, SerializedObject], serialized_object["value"] ).items() }, parent_path=serialized_object["full_access_path"],