Skip to content

Commit 0a65709

Browse files
committed
Added type hints to touchio
1 parent f822937 commit 0a65709

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

shared-bindings/touchio/TouchIn.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type,
7373
return (mp_obj_t) self;
7474
}
7575

76-
//| def deinit(self) -> Any:
76+
//| def deinit(self) -> None:
7777
//| """Deinitialises the TouchIn and releases any hardware resources for reuse."""
7878
//| ...
7979
//|
@@ -90,13 +90,13 @@ STATIC void check_for_deinit(touchio_touchin_obj_t *self) {
9090
}
9191
}
9292

93-
//| def __enter__(self) -> Any:
93+
//| def __enter__(self) -> TouchIn:
9494
//| """No-op used by Context Managers."""
9595
//| ...
9696
//|
9797
// Provided by context manager helper.
9898

99-
//| def __exit__(self) -> Any:
99+
//| def __exit__(self) -> None:
100100
//| """Automatically deinitializes the hardware when exiting a context. See
101101
//| :ref:`lifetime-and-contextmanagers` for more info."""
102102
//| ...
@@ -108,7 +108,7 @@ STATIC mp_obj_t touchio_touchin_obj___exit__(size_t n_args, const mp_obj_t *args
108108
}
109109
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(touchio_touchin___exit___obj, 4, 4, touchio_touchin_obj___exit__);
110110

111-
//| value: Any = ...
111+
//| value: bool = ...
112112
//| """Whether the touch pad is being touched or not. (read-only)
113113
//|
114114
//| True when `raw_value` > `threshold`."""
@@ -128,7 +128,7 @@ const mp_obj_property_t touchio_touchin_value_obj = {
128128
};
129129

130130

131-
//| raw_value: Any = ...
131+
//| raw_value: int = ...
132132
//| """The raw touch measurement as an `int`. (read-only)"""
133133
//|
134134
STATIC mp_obj_t touchio_touchin_obj_get_raw_value(mp_obj_t self_in) {
@@ -147,7 +147,7 @@ const mp_obj_property_t touchio_touchin_raw_value_obj = {
147147
};
148148

149149

150-
//| threshold: Any = ...
150+
//| threshold: Optional[int] = ...
151151
//| """Minimum `raw_value` needed to detect a touch (and for `value` to be `True`).
152152
//|
153153
//| When the **TouchIn** object is created, an initial `raw_value` is read from the pin,

0 commit comments

Comments
 (0)