From 03d3e0578ffc9fc2370c4987ab76e9b885a05286 Mon Sep 17 00:00:00 2001 From: link2xt Date: Mon, 28 Aug 2023 20:35:13 +0000 Subject: [PATCH] refactor(deltachat-rpc-client): drop support for keyword arguments All Rust methods have positional arguments and it is not going to change. --- deltachat-rpc-client/src/deltachat_rpc_client/rpc.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/rpc.py b/deltachat-rpc-client/src/deltachat_rpc_client/rpc.py index 72642625f..df65ffea1 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/rpc.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/rpc.py @@ -89,16 +89,14 @@ class Rpc: return await queue.get() def __getattr__(self, attr: str): - async def method(*args, **kwargs) -> Any: + async def method(*args) -> Any: self.id += 1 request_id = self.id - assert not (args and kwargs), "Mixing positional and keyword arguments" - request = { "jsonrpc": "2.0", "method": attr, - "params": kwargs or args, + "params": args, "id": self.id, } data = (json.dumps(request) + "\n").encode()