File tree 1 file changed +46
-0
lines changed
1 file changed +46
-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
+
21
+ class ROValueIO (Protocol ):
22
+ """Hardware objects, like `analogio.AnalogIn`, that have read-only
23
+ ``value`` properties/attributes.
24
+ """
25
+
26
+ @property
27
+ def value (self ) -> float :
28
+ """Value property, that may return an `int` or `float` depending
29
+ on the specifics of the class.
30
+ """
31
+
32
+
33
+ class ValueIO (Protocol ):
34
+ """Hardware objects, like `analogio.AnalogOut`, that have read and
35
+ write ``value`` properties/attributes.
36
+ """
37
+
38
+ @property
39
+ def value (self ) -> float :
40
+ """Value property, that may return an `int` or `float` depending
41
+ on the specifics of the class.
42
+ """
43
+
44
+ @value .setter
45
+ def value (self , input_value : float , / ):
46
+ ...
You can’t perform that action at this time.
0 commit comments