From c55ae827d77f3685a745cee82a83f8c33a50c802 Mon Sep 17 00:00:00 2001 From: Nicolas Kruse Date: Sun, 19 Oct 2025 22:48:39 +0200 Subject: [PATCH] specific tipe hints for read_value added --- src/copapy/__init__.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/copapy/__init__.py b/src/copapy/__init__.py index 39a4b4e..e5f0117 100644 --- a/src/copapy/__init__.py +++ b/src/copapy/__init__.py @@ -744,6 +744,22 @@ class Target(): dw.write_com(binw.Command.END_COM) assert coparun(dw.get_data()) > 0 + @overload + def read_value(self, net: cpbool) -> bool: + ... + + @overload + def read_value(self, net: cpfloat) -> float: + ... + + @overload + def read_value(self, net: cpint) -> int: + ... + + @overload + def read_value(self, net: NumLike) -> float | int | bool: + ... + def read_value(self, net: NumLike) -> float | int | bool: assert isinstance(net, Net), "Variable must be a copapy variable object" assert net in self._variables, f"Variable {net} not found"