Skip to content

Commit ed476a4

Browse files
committed
Added type hints to audiopwmio
1 parent e169da3 commit ed476a4

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

shared-bindings/audiopwmio/PWMAudioOut.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_make_new(const mp_obj_type_t *type, size_
114114
return MP_OBJ_FROM_PTR(self);
115115
}
116116

117-
//| def deinit(self, ) -> Any:
117+
//| def deinit(self, ) -> None:
118118
//| """Deinitialises the PWMAudioOut and releases any hardware resources for reuse."""
119119
//| ...
120120
//|
@@ -130,13 +130,13 @@ STATIC void check_for_deinit(audiopwmio_pwmaudioout_obj_t *self) {
130130
raise_deinited_error();
131131
}
132132
}
133-
//| def __enter__(self, ) -> Any:
133+
//| def __enter__(self, ) -> PWMAudioOut:
134134
//| """No-op used by Context Managers."""
135135
//| ...
136136
//|
137137
// Provided by context manager helper.
138138

139-
//| def __exit__(self, ) -> Any:
139+
//| def __exit__(self, ) -> None:
140140
//| """Automatically deinitializes the hardware when exiting a context. See
141141
//| :ref:`lifetime-and-contextmanagers` for more info."""
142142
//| ...
@@ -148,7 +148,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj___exit__(size_t n_args, const mp_obj_
148148
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiopwmio_pwmaudioout___exit___obj, 4, 4, audiopwmio_pwmaudioout_obj___exit__);
149149

150150

151-
//| def play(self, sample: Any, *, loop: Any = False) -> Any:
151+
//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer], *, loop: bool = False) -> None:
152152
//| """Plays the sample once when loop=False and continuously when loop=True.
153153
//| Does not block. Use `playing` to block.
154154
//|
@@ -177,7 +177,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_play(size_t n_args, const mp_obj_t *p
177177
}
178178
MP_DEFINE_CONST_FUN_OBJ_KW(audiopwmio_pwmaudioout_play_obj, 1, audiopwmio_pwmaudioout_obj_play);
179179

180-
//| def stop(self, ) -> Any:
180+
//| def stop(self, ) -> None:
181181
//| """Stops playback and resets to the start of the sample."""
182182
//| ...
183183
//|
@@ -189,7 +189,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_stop(mp_obj_t self_in) {
189189
}
190190
MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_stop_obj, audiopwmio_pwmaudioout_obj_stop);
191191

192-
//| playing: Any = ...
192+
//| playing: bool = ...
193193
//| """True when an audio sample is being output even if `paused`. (read-only)"""
194194
//|
195195
STATIC mp_obj_t audiopwmio_pwmaudioout_obj_get_playing(mp_obj_t self_in) {
@@ -206,7 +206,7 @@ const mp_obj_property_t audiopwmio_pwmaudioout_playing_obj = {
206206
(mp_obj_t)&mp_const_none_obj},
207207
};
208208

209-
//| def pause(self, ) -> Any:
209+
//| def pause(self, ) -> None:
210210
//| """Stops playback temporarily while remembering the position. Use `resume` to resume playback."""
211211
//| ...
212212
//|
@@ -222,7 +222,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_pause(mp_obj_t self_in) {
222222
}
223223
MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_pause_obj, audiopwmio_pwmaudioout_obj_pause);
224224

225-
//| def resume(self, ) -> Any:
225+
//| def resume(self, ) -> None:
226226
//| """Resumes sample playback after :py:func:`pause`."""
227227
//| ...
228228
//|
@@ -238,7 +238,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_resume(mp_obj_t self_in) {
238238
}
239239
MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_resume_obj, audiopwmio_pwmaudioout_obj_resume);
240240

241-
//| paused: Any = ...
241+
//| paused: bool = ...
242242
//| """True when playback is paused. (read-only)"""
243243
//|
244244
STATIC mp_obj_t audiopwmio_pwmaudioout_obj_get_paused(mp_obj_t self_in) {

0 commit comments

Comments
 (0)