Skip to content

Commit 522b17c

Browse files
committed
Made suggested changes
1 parent ac113fd commit 522b17c

13 files changed

Lines changed: 25 additions & 25 deletions

File tree

shared-bindings/aesio/aes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ STATIC void validate_length(aesio_aes_obj_t *self, size_t src_length,
152152
}
153153
}
154154

155-
//| def encrypt_into(src: Union[bytes, bytearray, memoryview], dest: Union[bytes, bytearray, memoryview]) -> None:
155+
//| def encrypt_into(src: Union[bytearray, memoryview], dest: Union[bytearray, memoryview]) -> None:
156156
//| """Encrypt the buffer from ``src`` into ``dest``.
157157
//|
158158
//| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the
@@ -183,7 +183,7 @@ STATIC mp_obj_t aesio_aes_encrypt_into(mp_obj_t aesio_obj, mp_obj_t src,
183183
STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_encrypt_into_obj,
184184
aesio_aes_encrypt_into);
185185

186-
//| def decrypt_into(src: Union[bytes, bytearray, memoryview], dest: Union[bytes, bytearray, memoryview]) -> None:
186+
//| def decrypt_into(src: Union[bytearray, memoryview], dest: Union[bytearray, memoryview]) -> None:
187187
//|
188188
//| """Decrypt the buffer from ``src`` into ``dest``.
189189
//| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the

shared-bindings/analogio/AnalogOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args)
9797
}
9898
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogout___exit___obj, 4, 4, analogio_analogout___exit__);
9999

100-
//| value: None = ...
100+
//| value: int = ...
101101
//| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only)
102102
//|
103103
//| Even if the underlying digital to analog converter (DAC) is lower

shared-bindings/audiobusio/I2SOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar
147147
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__);
148148

149149

150-
//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixe.Mixer], *, loop: Any = False) -> None:
150+
//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixe.Mixer], *, loop: bool = False) -> None:
151151
//| """Plays the sample once when loop=False and continuously when loop=True.
152152
//| Does not block. Use `playing` to block.
153153
//|

shared-bindings/audiobusio/PDMIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *arg
168168
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_pdmin___exit___obj, 4, 4, audiobusio_pdmin_obj___exit__);
169169

170170

171-
//| def record(self, destination: Union[bytes, bytearray, memoryview], destination_length: int) -> None:
171+
//| def record(self, destination: Union[bytearray, memoryview], destination_length: int) -> None:
172172
//| """Records destination_length bytes of samples to destination. This is
173173
//| blocking.
174174
//|

shared-bindings/audiocore/WaveFile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *arg
125125
}
126126
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_wavefile___exit___obj, 4, 4, audioio_wavefile_obj___exit__);
127127

128-
//| sample_rate: Optional(int) = ...
128+
//| sample_rate: Optional[int] = ...
129129
//| """32 bit value that dictates how quickly samples are loaded into the DAC
130130
//| in Hertz (cycles per second). When the sample is looped, this can change
131131
//| the pitch output without changing the underlying sample."""

shared-bindings/audioio/AudioOut.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_ar
111111
return MP_OBJ_FROM_PTR(self);
112112
}
113113

114-
//| def deinit(self, ) -> None:
114+
//| def deinit(self) -> None:
115115
//| """Deinitialises the AudioOut and releases any hardware resources for reuse."""
116116
//| ...
117117
//|
@@ -127,13 +127,13 @@ STATIC void check_for_deinit(audioio_audioout_obj_t *self) {
127127
raise_deinited_error();
128128
}
129129
}
130-
//| def __enter__(self, ) -> AudioOut:
130+
//| def __enter__(self) -> AudioOut:
131131
//| """No-op used by Context Managers."""
132132
//| ...
133133
//|
134134
// Provided by context manager helper.
135135

136-
//| def __exit__(self, ) -> None:
136+
//| def __exit__(self) -> None:
137137
//| """Automatically deinitializes the hardware when exiting a context. See
138138
//| :ref:`lifetime-and-contextmanagers` for more info."""
139139
//| ...
@@ -175,7 +175,7 @@ STATIC mp_obj_t audioio_audioout_obj_play(size_t n_args, const mp_obj_t *pos_arg
175175
}
176176
MP_DEFINE_CONST_FUN_OBJ_KW(audioio_audioout_play_obj, 1, audioio_audioout_obj_play);
177177

178-
//| def stop(self, ) -> None:
178+
//| def stop(self) -> None:
179179
//| """Stops playback and resets to the start of the sample."""
180180
//| ...
181181
//|
@@ -204,7 +204,7 @@ const mp_obj_property_t audioio_audioout_playing_obj = {
204204
(mp_obj_t)&mp_const_none_obj},
205205
};
206206

207-
//| def pause(self, ) -> None:
207+
//| def pause(self) -> None:
208208
//| """Stops playback temporarily while remembering the position. Use `resume` to resume playback."""
209209
//| ...
210210
//|
@@ -220,7 +220,7 @@ STATIC mp_obj_t audioio_audioout_obj_pause(mp_obj_t self_in) {
220220
}
221221
MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_pause_obj, audioio_audioout_obj_pause);
222222

223-
//| def resume(self, ) -> None:
223+
//| def resume(self) -> None:
224224
//| """Resumes sample playback after :py:func:`pause`."""
225225
//| ...
226226
//|

shared-bindings/audiomixer/MixerVoice.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_stop(size_t n_args, const mp_obj_t *po
100100
}
101101
MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_stop_obj, 1, audiomixer_mixervoice_obj_stop);
102102

103-
//| level: None = ...
103+
//| level: float = ...
104104
//| """The volume level of a voice, as a floating point number between 0 and 1."""
105105
//|
106106
STATIC mp_obj_t audiomixer_mixervoice_obj_get_level(mp_obj_t self_in) {

shared-bindings/audiomp3/MP3Decoder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
//| class MP3:
3838
//| """Load a mp3 file for audio playback"""
3939
//|
40-
//| def __init__(self, file: typing.BinaryIO, buffer: Union[bytes, bytearray, memoryview]):
40+
//| def __init__(self, file: typing.BinaryIO, buffer: Union[bytearray, memoryview]):
4141
//|
4242
//| """Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`.
4343
//|

shared-bindings/bitbangio/I2C.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) {
165165
}
166166
MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock);
167167

168-
//| def readfrom_into(self, address: int, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None) -> None:
168+
//| def readfrom_into(self, address: int, buffer: Union[bytearray, memoryview], *, start: int = 0, end: int = None) -> None:
169169
//| """Read into ``buffer`` from the device selected by ``address``.
170170
//| The number of bytes read will be the length of ``buffer``.
171171
//| At least one byte must be read.
@@ -277,7 +277,7 @@ STATIC mp_obj_t bitbangio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, m
277277
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_writeto);
278278

279279

280-
//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytes, bytearray, memoryview], in_buffer: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None:
280+
//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytearray, memoryview], in_buffer: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None:
281281
//| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop
282282
//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and
283283
//| ``in_buffer`` can be the same buffer because they are used sequentially.

shared-bindings/bitbangio/SPI.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ STATIC mp_obj_t bitbangio_spi_write(mp_obj_t self_in, mp_obj_t wr_buf) {
224224
MP_DEFINE_CONST_FUN_OBJ_2(bitbangio_spi_write_obj, bitbangio_spi_write);
225225

226226

227-
//| def readinto(self, buf: Union[bytes, bytearray, memoryview]) -> None:
227+
//| def readinto(self, buf: Union[bytearray, memoryview]) -> None:
228228
//| """Read into the buffer specified by ``buf`` while writing zeroes.
229229
//| Requires the SPI being locked.
230230
//| If the number of bytes to read is 0, nothing happens."""
@@ -248,7 +248,7 @@ STATIC mp_obj_t bitbangio_spi_readinto(size_t n_args, const mp_obj_t *args) {
248248
}
249249
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitbangio_spi_readinto_obj, 2, 2, bitbangio_spi_readinto);
250250

251-
//| def write_readinto(self, buffer_out: Union[bytes, bytearray, memoryview], buffer_in: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None:
251+
//| def write_readinto(self, buffer_out: Union[bytes, bytearray, memoryview], buffer_in: Union[bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None:
252252
//| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``.
253253
//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]``
254254
//| must be equal.

0 commit comments

Comments
 (0)