File tree 1 file changed +44
-0
lines changed
1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ # SPDX-FileCopyrightText: Copyright (c) 2022 Alec Delaney
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+
5
+ """
6
+ `circuitpython_typing.io`
7
+ ================================================================================
8
+
9
+ Type annotation definitions for IO-related objects
10
+
11
+ * Author(s): Alec Delaney
12
+ """
13
+
14
+ # Protocol was introduced in Python 3.8.
15
+ try :
16
+ from typing import Protocol
17
+ except ImportError :
18
+ from typing_extensions import Protocol
19
+
20
+ class ROValueIO (Protocol ):
21
+ """Hardware objects, like `analogio.AnalogIn`, that have read-only
22
+ ``value`` properties/attributes.
23
+ """
24
+
25
+ @property
26
+ def value (self ) -> float :
27
+ """Value property, that may return an `int` or `float` depending
28
+ on the specifics of the class.
29
+ """
30
+
31
+ class ValueIO (Protocol ):
32
+ """Hardware objects, like `analogio.AnalogOut`, that have read and
33
+ write ``value`` properties/attributes.
34
+ """
35
+
36
+ @property
37
+ def value (self ) -> float :
38
+ """Value property, that may return an `int` or `float` depending
39
+ on the specifics of the class.
40
+ """
41
+
42
+ @value .setter
43
+ def value (self , input_value : float , / ):
44
+ ...
You can’t perform that action at this time.
0 commit comments