This pull request primarily focuses on adding type annotations to various methods across multiple files to improve code clarity and type safety. The changes span several classes and methods, ensuring that return types and parameter types are explicitly defined.
Type Annotations:
src/blinkstick/backends/base.py: Added type annotations to methods in the BaseBackend class, specifying return types for methods like get_serial, get_manufacturer, get_version_attribute, and get_description.
src/blinkstick/backends/unix_like.py: Introduced type annotations for methods in the UnixLikeBackend class, including open_device, get_manufacturer, get_version_attribute, and _usb_get_string. Removed an unnecessary return statement in open_device. [1][2][3]
src/blinkstick/backends/win32.py: Updated methods in the Win32Backend class to include type annotations for methods such as get_serial, get_manufacturer, get_version_attribute, and get_description.
This pull request primarily focuses on adding type annotations to various methods across multiple files to improve code clarity and type safety. The changes span several classes and methods, ensuring that return types and parameter types are explicitly defined.
Type Annotations:
src/blinkstick/backends/base.py
: Added type annotations to methods in theBaseBackend
class, specifying return types for methods likeget_serial
,get_manufacturer
,get_version_attribute
, andget_description
.src/blinkstick/backends/unix_like.py
: Introduced type annotations for methods in theUnixLikeBackend
class, includingopen_device
,get_manufacturer
,get_version_attribute
, and_usb_get_string
. Removed an unnecessary return statement inopen_device
. [1] [2] [3]src/blinkstick/backends/win32.py
: Updated methods in theWin32Backend
class to include type annotations for methods such asget_serial
,get_manufacturer
,get_version_attribute
, andget_description
.src/blinkstick/blinkstick.py
: Added type annotations to numerous methods in theBlinkStick
andBlinkStickPro
classes, covering methods likeget_serial
,set_color
,get_color
,set_mode
,get_mode
, and more. Also included type annotations for class attributes and parameters in constructors. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27]These changes enhance the readability and maintainability of the code by making the expected types of method parameters and return values explicit.