From 16cde520a75250a51b21765cfcd5363c7f6a4068 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Thu, 17 Feb 2022 09:39:15 -0500 Subject: [PATCH] Use rtype to clarify types returned because of __get__() `UnaryStruct` uses __get__() to return a different type, but this is unclear currently because now that these variable have type annotations, class variable utilizing ot are automatically typed as `UnaryStruct`. While one option is to manually document the class variables, I think it's preferable to use an attached docstring so the documentation and code don't ever get split up if one is removed for some reason. Using Sphinx `rtype` seems to be the best way to document it then. --- adafruit_as7341.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/adafruit_as7341.py b/adafruit_as7341.py index 0dd625b..a5ddfa3 100644 --- a/adafruit_as7341.py +++ b/adafruit_as7341.py @@ -325,12 +325,20 @@ class AS7341: # pylint:disable=too-many-instance-attributes, no-member _all_channels: Struct = Struct(_AS7341_ASTATUS, "