From: Vincent Fazio Date: Thu, 14 Nov 2024 14:51:00 +0000 (-0600) Subject: bindings: python: add type hint for the sec variable in poll_fd X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2a2904082fd1bbbf5863dccd4184873c5826ae72;p=qemu-gpiodev%2Flibgpiod.git bindings: python: add type hint for the sec variable in poll_fd The sec variable can be either a float or None, so type it accordingly to avoid complaints from type checkers. Signed-off-by: Vincent Fazio Link: https://lore.kernel.org/r/20241114145116.2123714-8-vfazio@xes-inc.com Signed-off-by: Bartosz Golaszewski --- diff --git a/bindings/python/gpiod/_internal.py b/bindings/python/gpiod/_internal.py index d1e95e4..c9b5d28 100644 --- a/bindings/python/gpiod/_internal.py +++ b/bindings/python/gpiod/_internal.py @@ -9,6 +9,7 @@ __all__ = ["poll_fd"] def poll_fd(fd: int, timeout: Optional[Union[timedelta, float]] = None) -> bool: + sec: Union[float, None] if isinstance(timeout, timedelta): sec = timeout.total_seconds() else: