@@ -96,7 +96,7 @@ STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_arg
9696 return MP_OBJ_FROM_PTR (self );
9797}
9898
99- //| def deinit(self) -> Any :
99+ //| def deinit(self) -> None :
100100//| """Deinitialises the PulseIn and releases any hardware resources for reuse."""
101101//| ...
102102//|
@@ -113,13 +113,13 @@ STATIC void check_for_deinit(pulseio_pulsein_obj_t *self) {
113113 }
114114}
115115
116- //| def __enter__(self) -> Any :
116+ //| def __enter__(self) -> PulseIn :
117117//| """No-op used by Context Managers."""
118118//| ...
119119//|
120120// Provided by context manager helper.
121121
122- //| def __exit__(self) -> Any :
122+ //| def __exit__(self) -> None :
123123//| """Automatically deinitializes the hardware when exiting a context. See
124124//| :ref:`lifetime-and-contextmanagers` for more info."""
125125//| ...
@@ -131,7 +131,7 @@ STATIC mp_obj_t pulseio_pulsein_obj___exit__(size_t n_args, const mp_obj_t *args
131131}
132132STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (pulseio_pulsein___exit___obj , 4 , 4 , pulseio_pulsein_obj___exit__ );
133133
134- //| def pause(self) -> Any :
134+ //| def pause(self) -> None :
135135//| """Pause pulse capture"""
136136//| ...
137137//|
@@ -144,7 +144,7 @@ STATIC mp_obj_t pulseio_pulsein_obj_pause(mp_obj_t self_in) {
144144}
145145MP_DEFINE_CONST_FUN_OBJ_1 (pulseio_pulsein_pause_obj , pulseio_pulsein_obj_pause );
146146
147- //| def resume(self, trigger_duration: int = 0) -> Any :
147+ //| def resume(self, trigger_duration: int = 0) -> None :
148148//| """Resumes pulse capture after an optional trigger pulse.
149149//|
150150//| .. warning:: Using trigger pulse with a device that drives both high and
@@ -171,7 +171,7 @@ STATIC mp_obj_t pulseio_pulsein_obj_resume(size_t n_args, const mp_obj_t *pos_ar
171171}
172172MP_DEFINE_CONST_FUN_OBJ_KW (pulseio_pulsein_resume_obj , 1 , pulseio_pulsein_obj_resume );
173173
174- //| def clear(self) -> Any :
174+ //| def clear(self) -> None :
175175//| """Clears all captured pulses"""
176176//| ...
177177//|
@@ -184,7 +184,7 @@ STATIC mp_obj_t pulseio_pulsein_obj_clear(mp_obj_t self_in) {
184184}
185185MP_DEFINE_CONST_FUN_OBJ_1 (pulseio_pulsein_clear_obj , pulseio_pulsein_obj_clear );
186186
187- //| def popleft(self) -> Any :
187+ //| def popleft(self) -> int :
188188//| """Removes and returns the oldest read pulse."""
189189//| ...
190190//|
@@ -196,7 +196,7 @@ STATIC mp_obj_t pulseio_pulsein_obj_popleft(mp_obj_t self_in) {
196196}
197197MP_DEFINE_CONST_FUN_OBJ_1 (pulseio_pulsein_popleft_obj , pulseio_pulsein_obj_popleft );
198198
199- //| maxlen: Any = ...
199+ //| maxlen: int = ...
200200//| """The maximum length of the PulseIn. When len() is equal to maxlen,
201201//| it is unclear which pulses are active and which are idle."""
202202//|
@@ -215,7 +215,7 @@ const mp_obj_property_t pulseio_pulsein_maxlen_obj = {
215215 (mp_obj_t )& mp_const_none_obj },
216216};
217217
218- //| paused: Any = ...
218+ //| paused: bool = ...
219219//| """True when pulse capture is paused as a result of :py:func:`pause` or an error during capture
220220//| such as a signal that is too fast."""
221221//|
@@ -234,7 +234,7 @@ const mp_obj_property_t pulseio_pulsein_paused_obj = {
234234 (mp_obj_t )& mp_const_none_obj },
235235};
236236
237- //| def __len__(self) -> Any :
237+ //| def __len__(self) -> Union[bool, int, None] :
238238//| """Returns the current pulse length
239239//|
240240//| This allows you to::
@@ -254,7 +254,7 @@ STATIC mp_obj_t pulsein_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
254254 }
255255}
256256
257- //| def __getitem__(self, index: Any ) -> Any :
257+ //| def __getitem__(self, index: int ) -> Optional[int] :
258258//| """Returns the value at the given index or values in slice.
259259//|
260260//| This allows you to::
0 commit comments