diff mbox series

[libgpiod,08/22] bindings: python: annotate internal members of LineRequest

Message ID 20240927-vfazio-mypy-v1-8-91a7c2e20884@xes-inc.com
State New
Headers show
Series bindings: python: conform to mypy and ruff linter recommendations | expand

Commit Message

Vincent Fazio Sept. 27, 2024, 6:53 p.m. UTC
Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
---
 bindings/python/gpiod/line_request.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Bartosz Golaszewski Oct. 8, 2024, 1:17 p.m. UTC | #1
On Fri, Sep 27, 2024 at 8:57 PM Vincent Fazio <vfazio@xes-inc.com> wrote:
>
> Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
> ---
>  bindings/python/gpiod/line_request.py | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/bindings/python/gpiod/line_request.py b/bindings/python/gpiod/line_request.py
> index f94b6b50d72486da1446abcda8282a8dc6d6e620..77d199ac64e9d3cc68d4a8b38dd0f571a24ab231 100644
> --- a/bindings/python/gpiod/line_request.py
> +++ b/bindings/python/gpiod/line_request.py
> @@ -30,7 +30,12 @@ class LineRequest:
>          LineRequest objects can only be instantiated by a Chip parent. This is
>          not part of stable API.
>          """
> -        self._req = req
> +        self._req: Union[_ext.Request, None] = req
> +        self._chip_name: str
> +        self._offsets: list[int]
> +        self._name_map: dict[str, int]
> +        self._offset_map: dict[int, str]
> +        self._lines: list[Union[int, str]]
>
>      def __bool__(self) -> bool:
>          """
>
> --
> 2.34.1
>

+commit message and LGTM

Bart
diff mbox series

Patch

diff --git a/bindings/python/gpiod/line_request.py b/bindings/python/gpiod/line_request.py
index f94b6b50d72486da1446abcda8282a8dc6d6e620..77d199ac64e9d3cc68d4a8b38dd0f571a24ab231 100644
--- a/bindings/python/gpiod/line_request.py
+++ b/bindings/python/gpiod/line_request.py
@@ -30,7 +30,12 @@  class LineRequest:
         LineRequest objects can only be instantiated by a Chip parent. This is
         not part of stable API.
         """
-        self._req = req
+        self._req: Union[_ext.Request, None] = req
+        self._chip_name: str
+        self._offsets: list[int]
+        self._name_map: dict[str, int]
+        self._offset_map: dict[int, str]
+        self._lines: list[Union[int, str]]
 
     def __bool__(self) -> bool:
         """