circuitpython_stubs: Use circuitpython_typing for cp-specific typing

Installing stubs for a module named `_typing` seems like a dubious
decision.
This commit is contained in:
Jeff Epler 2021-12-21 14:28:49 -06:00 committed by Jeff Epler
parent 7f189b3e30
commit 166793f843
33 changed files with 55 additions and 55 deletions

View File

@ -354,7 +354,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_obj, rp2pio_statemachine_stop
//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None) -> None:
//| """Write the data contained in ``buffer`` to the state machine. If the buffer is empty, nothing happens.
//|
//| :param ~_typing.ReadableBuffer buffer: Write out the data in this buffer
//| :param ~circuitpython_typing.ReadableBuffer buffer: Write out the data in this buffer
//| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]``
//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``"""
//| ...
@ -402,7 +402,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine
//| """Read into ``buffer``. If the number of bytes to read is 0, nothing happens. The buffer
//| include any data added to the fifo even if it was added before this was called.
//|
//| :param ~_typing.WriteableBuffer buffer: Read data into this buffer
//| :param ~circuitpython_typing.WriteableBuffer buffer: Read data into this buffer
//| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]``
//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``"""
//| ...
@ -450,8 +450,8 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_readinto_obj, 2, rp2pio_statemach
//| may be different. The function will return once both are filled.
//| If buffer slice lengths are both 0, nothing happens.
//|
//| :param ~_typing.ReadableBuffer buffer_out: Write out the data in this buffer
//| :param ~_typing.WriteableBuffer buffer_in: Read data into this buffer
//| :param ~circuitpython_typing.ReadableBuffer buffer_out: Write out the data in this buffer
//| :param ~circuitpython_typing.WriteableBuffer buffer_in: Read data into this buffer
//| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]``
//| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)``
//| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]``

View File

@ -196,8 +196,8 @@ const mp_obj_property_t bleio_adapter_name_obj = {
//| .. note:: If you set ``anonymous=True``, then a timeout must be specified. If no timeout is
//| specified, then the maximum allowed timeout will be selected automatically.
//|
//| :param ~_typing.ReadableBuffer data: advertising data packet bytes
//| :param ~_typing.ReadableBuffer scan_response: scan response data packet bytes. ``None`` if no scan response is needed.
//| :param ~circuitpython_typing.ReadableBuffer data: advertising data packet bytes
//| :param ~circuitpython_typing.ReadableBuffer scan_response: scan response data packet bytes. ``None`` if no scan response is needed.
//| :param bool connectable: If `True` then other devices are allowed to connect to this peripheral.
//| :param bool anonymous: If `True` then this device's MAC address is randomized before advertising.
//| :param int timeout: If set, we will only advertise for this many seconds. Zero means no timeout.
@ -282,7 +282,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_advertising_obj, bleio_adapt
//| """Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are
//| filtered and returned separately.
//|
//| :param ~_typing.ReadableBuffer prefixes: Sequence of byte string prefixes to filter advertising packets
//| :param ~circuitpython_typing.ReadableBuffer prefixes: Sequence of byte string prefixes to filter advertising packets
//| with. A packet without an advertising structure that matches one of the prefixes is
//| ignored. Format is one byte for length (n) and n bytes of prefix and can be repeated.
//| :param int buffer_size: the maximum number of advertising bytes to buffer.

View File

@ -42,7 +42,7 @@
//| """Create a new Address object encapsulating the address value.
//| The value itself can be one of:
//|
//| :param ~_typing.ReadableBuffer address: The address value to encapsulate. A buffer object (bytearray, bytes) of 6 bytes.
//| :param ~circuitpython_typing.ReadableBuffer address: The address value to encapsulate. A buffer object (bytearray, bytes) of 6 bytes.
//| :param int address_type: one of the integer values: `PUBLIC`, `RANDOM_STATIC`,
//| `RANDOM_PRIVATE_RESOLVABLE`, or `RANDOM_PRIVATE_NON_RESOLVABLE`."""
//| ...

View File

@ -67,7 +67,7 @@
//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum
//| number of data bytes that fit in a single BLE 4.x ATT packet.
//| :param bool fixed_length: True if the characteristic value is of fixed length.
//| :param ~_typing.ReadableBuffer initial_value: The initial value for this characteristic. If not given, will be
//| :param ~circuitpython_typing.ReadableBuffer initial_value: The initial value for this characteristic. If not given, will be
//| filled with zeros.
//| :param str user_description: User friendly description of the characteristic
//|

View File

@ -61,7 +61,7 @@
//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum
//| number of data bytes that fit in a single BLE 4.x ATT packet.
//| :param bool fixed_length: True if the descriptor value is of fixed length.
//| :param ~_typing.ReadableBuffer initial_value: The initial value for this descriptor.
//| :param ~circuitpython_typing.ReadableBuffer initial_value: The initial value for this descriptor.
//|
//| :return: the new Descriptor."""
//| ...

View File

@ -48,7 +48,7 @@
//| temporary 16-bit UUID that can be used in place of the full 128-bit UUID.
//|
//| :param value: The uuid value to encapsulate
//| :type value: int, ~_typing.ReadableBuffer or str"""
//| :type value: int, ~circuitpython_typing.ReadableBuffer or str"""
//| ...
//|
STATIC mp_obj_t bleio_uuid_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {

View File

@ -79,7 +79,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(flush_obj, _flush);
//| def cc(self, b: ReadableBuffer) -> None:
//| """Append bytes to the command FIFO.
//|
//| :param ~_typing.ReadableBuffer b: The bytes to add"""
//| :param ~circuitpython_typing.ReadableBuffer b: The bytes to add"""
//| ...
//|
STATIC mp_obj_t _cc(mp_obj_t self, mp_obj_t b) {

View File

@ -40,9 +40,9 @@
//|
//| :param int width: The width of the grid in tiles, or 1 for sprites.
//| :param int height: The height of the grid in tiles, or 1 for sprites.
//| :param ~_typing.ReadableBuffer graphic: The graphic data of the tiles.
//| :param ~_typing.ReadableBuffer palette: The color palette to be used.
//| :param ~_typing.ReadableBuffer grid: The contents of the grid map.
//| :param ~circuitpython_typing.ReadableBuffer graphic: The graphic data of the tiles.
//| :param ~circuitpython_typing.ReadableBuffer palette: The color palette to be used.
//| :param ~circuitpython_typing.ReadableBuffer grid: The contents of the grid map.
//|
//| This class is intended for internal use in the ``stage`` library and
//| it shouldn't be used on its own."""

View File

@ -40,9 +40,9 @@
//|
//| :param int width: The width of the grid in tiles, or 1 for sprites.
//| :param int height: The height of the grid in tiles, or 1 for sprites.
//| :param ~_typing.ReadableBuffer font: The font data of the characters.
//| :param ~_typing.ReadableBuffer palette: The color palette to be used.
//| :param ~_typing.ReadableBuffer chars: The contents of the character grid.
//| :param ~circuitpython_typing.ReadableBuffer font: The font data of the characters.
//| :param ~circuitpython_typing.ReadableBuffer palette: The color palette to be used.
//| :param ~circuitpython_typing.ReadableBuffer chars: The contents of the character grid.
//|
//| This class is intended for internal use in the ``stage`` library and
//| it shouldn't be used on its own."""

View File

@ -48,7 +48,7 @@
//| :param int y1: Bottom edge of the fragment.
//| :param layers: A list of the :py:class:`~_stage.Layer` objects.
//| :type layers: list[Layer]
//| :param ~_typing.WriteableBuffer buffer: A buffer to use for rendering.
//| :param ~circuitpython_typing.WriteableBuffer buffer: A buffer to use for rendering.
//| :param ~displayio.Display display: The display to use.
//| :param int scale: How many times should the image be scaled up.
//| :param int background: What color to display when nothing is there.

View File

@ -64,8 +64,8 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t
//| :param str byteorder: Byte order string (such as "RGB", "RGBW" or "PBGR")
//| :param float brightness: Brightness (0 to 1.0, default 1.0)
//| :param bool auto_write: Whether to automatically write pixels (Default False)
//| :param ~_typing.ReadableBuffer header: Sequence of bytes to always send before pixel values.
//| :param ~_typing.ReadableBuffer trailer: Sequence of bytes to always send after pixel values."""
//| :param ~circuitpython_typing.ReadableBuffer header: Sequence of bytes to always send before pixel values.
//| :param ~circuitpython_typing.ReadableBuffer trailer: Sequence of bytes to always send after pixel values."""
//| ...
//|
STATIC mp_obj_t pixelbuf_pixelbuf_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {

View File

@ -19,10 +19,10 @@
//| def __init__(self, key: ReadableBuffer, mode: int = 0, iv: Optional[ReadableBuffer] = None, segment_size: int = 8) -> None:
//| """Create a new AES state with the given key.
//|
//| :param ~_typing.ReadableBuffer key: A 16-, 24-, or 32-byte key
//| :param ~circuitpython_typing.ReadableBuffer key: A 16-, 24-, or 32-byte key
//| :param int mode: AES mode to use. One of: `MODE_ECB`, `MODE_CBC`, or
//| `MODE_CTR`
//| :param ~_typing.ReadableBuffer iv: Initialization vector to use for CBC or CTR mode
//| :param ~circuitpython_typing.ReadableBuffer iv: Initialization vector to use for CBC or CTR mode
//|
//| Additional arguments are supported for legacy reasons.
//|

View File

@ -155,7 +155,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__);
//| def play(self, sample: _typing.AudioSample, *, loop: bool = False) -> None:
//| def play(self, sample: circuitpython_typing.AudioSample, *, loop: bool = False) -> None:
//| """Plays the sample once when loop=False and continuously when loop=True.
//| Does not block. Use `playing` to block.
//|

View File

@ -43,7 +43,7 @@
//| first sample will be for channel 1, the second sample will be for channel two, the third for
//| channel 1 and so on.
//|
//| :param ~_typing.ReadableBuffer buffer: A buffer with samples
//| :param ~circuitpython_typing.ReadableBuffer buffer: A buffer with samples
//| :param int channel_count: The number of channels in the buffer
//| :param int sample_rate: The desired playback sample rate
//|

View File

@ -44,7 +44,7 @@
//| """Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`.
//|
//| :param typing.BinaryIO file: Already opened wave file
//| :param ~_typing.WriteableBuffer buffer: Optional pre-allocated buffer,
//| :param ~circuitpython_typing.WriteableBuffer buffer: Optional pre-allocated buffer,
//| that will be split in half and used for double-buffering of the data.
//| The buffer must be 8 to 1024 bytes long.
//| If not provided, two 256 byte buffers are initially allocated internally.

View File

@ -146,7 +146,7 @@ STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *arg
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_audioout___exit___obj, 4, 4, audioio_audioout_obj___exit__);
//| def play(self, sample: _typing.AudioSample, *, loop: bool = False) -> None:
//| def play(self, sample: circuitpython_typing.AudioSample, *, loop: bool = False) -> None:
//| """Plays the sample once when loop=False and continuously when loop=True.
//| Does not block. Use `playing` to block.
//|

View File

@ -211,7 +211,7 @@ const mp_obj_property_t audiomixer_mixer_voice_obj = {
MP_ROM_NONE},
};
//| def play(self, sample: _typing.AudioSample, *, voice: int = 0, loop: bool = False) -> None:
//| def play(self, sample: circuitpython_typing.AudioSample, *, voice: int = 0, loop: bool = False) -> None:
//| """Plays the sample once when loop=False and continuously when loop=True.
//| Does not block. Use `playing` to block.
//|

View File

@ -57,7 +57,7 @@ STATIC mp_obj_t audiomixer_mixervoice_make_new(const mp_obj_type_t *type, size_t
return MP_OBJ_FROM_PTR(self);
}
//| def play(self, sample: _typing.AudioSample, *, loop: bool = False) -> None:
//| def play(self, sample: circuitpython_typing.AudioSample, *, loop: bool = False) -> None:
//| """Plays the sample once when ``loop=False``, and continuously when ``loop=True``.
//| Does not block. Use `playing` to block.
//|

View File

@ -42,7 +42,7 @@
//| """Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`.
//|
//| :param typing.BinaryIO file: Already opened mp3 file
//| :param ~_typing.WriteableBuffer buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file.
//| :param ~circuitpython_typing.WriteableBuffer buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file.
//|
//|
//| Playing a mp3 file from flash::

View File

@ -148,7 +148,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj___exit__(size_t n_args, const mp_obj_
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiopwmio_pwmaudioout___exit___obj, 4, 4, audiopwmio_pwmaudioout_obj___exit__);
//| def play(self, sample: _typing.AudioSample, *, loop: bool = False) -> None:
//| def play(self, sample: circuitpython_typing.AudioSample, *, loop: bool = False) -> None:
//| """Plays the sample once when loop=False and continuously when loop=True.
//| Does not block. Use `playing` to block.
//|

View File

@ -292,8 +292,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_wr
//| The number of bytes read will be the length of ``out_buffer[in_start:in_end]``.
//| :param int address: 7-bit device address
//| :param ~_typing.ReadableBuffer out_buffer: buffer containing the bytes to write
//| :param ~_typing.WriteableBuffer in_buffer: buffer to write into
//| :param ~circuitpython_typing.ReadableBuffer out_buffer: buffer containing the bytes to write
//| :param ~circuitpython_typing.WriteableBuffer in_buffer: buffer to write into
//| :param int out_start: beginning of ``out_buffer`` slice
//| :param int out_end: end of ``out_buffer`` slice; if not specified, use ``len(out_buffer)``
//| :param int in_start: beginning of ``in_buffer`` slice

View File

@ -299,8 +299,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto);
//| The number of bytes read will be the length of ``out_buffer[in_start:in_end]``.
//| :param int address: 7-bit device address
//| :param ~_typing.ReadableBuffer out_buffer: buffer containing the bytes to write
//| :param ~_typing.WriteableBuffer in_buffer: buffer to write into
//| :param ~circuitpython_typing.ReadableBuffer out_buffer: buffer containing the bytes to write
//| :param ~circuitpython_typing.WriteableBuffer in_buffer: buffer to write into
//| :param int out_start: beginning of ``out_buffer`` slice
//| :param int out_end: end of ``out_buffer`` slice; if not specified, use ``len(out_buffer)``
//| :param int in_start: beginning of ``in_buffer`` slice

View File

@ -84,7 +84,7 @@
//|
//| :param display_bus: The bus that the display is connected to
//| :type _DisplayBus: FourWire, ParallelBus or I2CDisplay
//| :param ~_typing.ReadableBuffer init_sequence: Byte-packed initialization sequence.
//| :param ~circuitpython_typing.ReadableBuffer init_sequence: Byte-packed initialization sequence.
//| :param int width: Width in pixels
//| :param int height: Height in pixels
//| :param int colstart: The index if the first visible column
@ -449,7 +449,7 @@ const mp_obj_property_t displayio_display_bus_obj = {
//| """Extract the pixels from a single row
//|
//| :param int y: The top edge of the area
//| :param ~_typing.WriteableBuffer buffer: The buffer in which to place the pixel data"""
//| :param ~circuitpython_typing.WriteableBuffer buffer: The buffer in which to place the pixel data"""
//| ...
//|
STATIC mp_obj_t displayio_display_obj_fill_row(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {

View File

@ -76,8 +76,8 @@
//|
//| :param display_bus: The bus that the display is connected to
//| :type _DisplayBus: displayio.FourWire or paralleldisplay.ParallelBus
//| :param ~_typing.ReadableBuffer start_sequence: Byte-packed initialization sequence.
//| :param ~_typing.ReadableBuffer stop_sequence: Byte-packed initialization sequence.
//| :param ~circuitpython_typing.ReadableBuffer start_sequence: Byte-packed initialization sequence.
//| :param ~circuitpython_typing.ReadableBuffer stop_sequence: Byte-packed initialization sequence.
//| :param int width: Width in pixels
//| :param int height: Height in pixels
//| :param int ram_width: RAM width in pixels

View File

@ -47,10 +47,10 @@
//| objects in CircuitPython, Display objects live until `displayio.release_displays()`
//| is called. This is done so that CircuitPython can use the display itself."""
//|
//| def __init__(self, framebuffer: _typing.FrameBuffer, *, rotation: int = 0, auto_refresh: bool = True) -> None:
//| def __init__(self, framebuffer: circuitpython_typing.FrameBuffer, *, rotation: int = 0, auto_refresh: bool = True) -> None:
//| """Create a Display object with the given framebuffer (a buffer, array, ulab.array, etc)
//|
//| :param ~_typing.FrameBuffer framebuffer: The framebuffer that the display is connected to
//| :param ~circuitpython_typing.FrameBuffer framebuffer: The framebuffer that the display is connected to
//| :param bool auto_refresh: Automatically refresh the screen
//| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270)"""
//| ...
@ -298,7 +298,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_rotation_obj = {
MP_ROM_NONE},
};
//| framebuffer: _typing.FrameBuffer
//| framebuffer: circuitpython_typing.FrameBuffer
//| """The framebuffer being used by the display"""
//|
//|
@ -320,7 +320,7 @@ const mp_obj_property_t framebufferio_framebufferframebuffer_obj = {
//| """Extract the pixels from a single row
//|
//| :param int y: The top edge of the area
//| :param ~_typing.WriteableBuffer buffer: The buffer in which to place the pixel data"""
//| :param ~circuitpython_typing.WriteableBuffer buffer: The buffer in which to place the pixel data"""
//| ...
//|
STATIC mp_obj_t framebufferio_framebufferdisplay_obj_fill_row(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {

View File

@ -353,7 +353,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_read_obj, 1, i2c
//| def write(self, buffer: ReadableBuffer) -> int:
//| """Write the data contained in buffer.
//|
//| :param ~_typing.ReadableBuffer buffer: Write out the data in this buffer
//| :param ~circuitpython_typing.ReadableBuffer buffer: Write out the data in this buffer
//| :return: Number of bytes written"""
//| ...
//|

View File

@ -87,8 +87,8 @@
//| """Ouput object to buffer in msgpack format.
//|
//| :param object obj: Object to convert to msgpack format.
//| :param ~_typing.WriteableBuffer buffer: buffer to write into
//| :param Optional[~_typing.Callable[[object], None]] default:
//| :param ~circuitpython_typing.WriteableBuffer buffer: buffer to write into
//| :param Optional[~circuitpython_typing.Callable[[object], None]] default:
//| function called for python objects that do not have
//| a representation in msgpack format.
//| """
@ -118,8 +118,8 @@ MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_pack_obj, 0, mod_msgpack_pack);
//| def unpack(buffer: ReadableBuffer, *, ext_hook: Union[Callable[[int, bytes], object], None] = None, use_list: bool=True) -> object:
//| """Unpack and return one object from buffer.
//|
//| :param ~_typing.ReadableBuffer buffer: buffer to read from
//| :param Optional[~_typing.Callable[[int, bytes], object]] ext_hook: function called for objects in
//| :param ~circuitpython_typing.ReadableBuffer buffer: buffer to read from
//| :param Optional[~circuitpython_typing.Callable[[int, bytes], object]] ext_hook: function called for objects in
//| msgpack ext format.
//| :param Optional[bool] use_list: return array as list or tuple (use_list=False).
//|

View File

@ -54,7 +54,7 @@
//| """Write buf out on the given DigitalInOut.
//|
//| :param ~digitalio.DigitalInOut digitalinout: the DigitalInOut to output with
//| :param ~_typing.ReadableBuffer buf: The bytes to clock out. No assumption is made about color order"""
//| :param ~circuitpython_typing.ReadableBuffer buf: The bytes to clock out. No assumption is made about color order"""
//| ...
STATIC mp_obj_t neopixel_write_neopixel_write_(mp_obj_t digitalinout_obj, mp_obj_t buf) {
if (!mp_obj_is_type(digitalinout_obj, &digitalio_digitalinout_type)) {

View File

@ -130,7 +130,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_deinit_obj, sdcardio_sdcard_deinit);
//| """Read one or more blocks from the card
//|
//| :param int start_block: The block to start reading from
//| :param ~_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512.
//| :param ~circuitpython_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512.
//|
//| :return: None"""
//|
@ -171,7 +171,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_sync_obj, sdcardio_sdcard_sync);
//| """Write one or more blocks to the card
//|
//| :param int start_block: The block to start writing from
//| :param ~_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512.
//| :param ~circuitpython_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512.
//|
//| :return: None"""
//|

View File

@ -165,7 +165,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_count_obj, sdioio_sdcard_count);
//| """Read one or more blocks from the card
//|
//| :param int start_block: The block to start reading from
//| :param ~_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512.
//| :param ~circuitpython_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512.
//|
//| :return: None"""
STATIC mp_obj_t sdioio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) {
@ -187,7 +187,7 @@ MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_readblocks_obj, sdioio_sdcard_readblocks
//| """Write one or more blocks to the card
//|
//| :param int start_block: The block to start writing from
//| :param ~_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512.
//| :param ~circuitpython_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512.
//|
//| :return: None"""
//|

View File

@ -42,7 +42,7 @@
//| are supported; channel numbers and key velocities are ignored. Up to two notes may be on at the
//| same time.
//|
//| :param ~_typing.ReadableBuffer buffer: Stream of MIDI events, as stored in a MIDI file track chunk
//| :param ~circuitpython_typing.ReadableBuffer buffer: Stream of MIDI events, as stored in a MIDI file track chunk
//| :param int tempo: Tempo of the streamed events, in MIDI ticks per second
//| :param int sample_rate: The desired playback sample rate; higher sample rate requires more memory
//|

View File

@ -244,7 +244,7 @@ def convert_folder(top_level, stub_directory):
if imports["typing"]:
import_lines.append("from typing import " + ", ".join(imports["typing"]))
if imports["cpy_typing"]:
import_lines.append("from _typing import " + ", ".join(imports["cpy_typing"]))
import_lines.append("from circuitpython_typing import " + ", ".join(imports["cpy_typing"]))
import_lines.extend(f"import {m}" for m in imports["modules"])
import_body = "\n".join(import_lines)
m = re.match(r'(\s*""".*?""")', stub_contents, flags=re.DOTALL)