summaryrefslogtreecommitdiff
path: root/shared-bindings
diff options
context:
space:
mode:
authordherrada <dylan.herrada@adafruit.com>2020-07-03 13:49:00 -0400
committerdherrada <dylan.herrada@adafruit.com>2020-07-03 13:49:00 -0400
commit3df03a565069d6e8874eb678d4f010eee97305b0 (patch)
tree5a98c58eabc6b7d2654f899c9b7582fbea9daa94 /shared-bindings
parent843ff5d30271709186a117877ff0521b769ae8d1 (diff)
Made most of the requested changes
Diffstat (limited to 'shared-bindings')
-rw-r--r--shared-bindings/_bleio/Adapter.c4
-rw-r--r--shared-bindings/_bleio/Address.c6
-rw-r--r--shared-bindings/_bleio/Connection.c2
-rw-r--r--shared-bindings/_bleio/PacketBuffer.c2
-rw-r--r--shared-bindings/_bleio/ScanEntry.c2
-rw-r--r--shared-bindings/_bleio/ScanResults.c4
-rw-r--r--shared-bindings/_bleio/Service.c2
-rw-r--r--shared-bindings/_bleio/UUID.c4
-rw-r--r--shared-bindings/_bleio/__init__.c30
-rw-r--r--shared-bindings/_eve/__init__.c18
-rw-r--r--shared-bindings/_pew/PewPew.c2
-rw-r--r--shared-bindings/_pixelbuf/PixelBuf.c2
-rw-r--r--shared-bindings/aesio/aes.c6
-rw-r--r--shared-bindings/audiobusio/I2SOut.c2
-rw-r--r--shared-bindings/audiocore/WaveFile.c2
-rw-r--r--shared-bindings/audiomixer/Mixer.c2
-rw-r--r--shared-bindings/audiomixer/MixerVoice.c2
-rw-r--r--shared-bindings/audiomp3/MP3Decoder.c4
-rw-r--r--shared-bindings/busio/SPI.c6
-rw-r--r--shared-bindings/busio/UART.c2
-rw-r--r--shared-bindings/displayio/Display.c4
-rw-r--r--shared-bindings/displayio/EPaperDisplay.c2
-rw-r--r--shared-bindings/displayio/Group.c12
-rw-r--r--shared-bindings/displayio/I2CDisplay.c2
-rw-r--r--shared-bindings/displayio/Palette.c4
-rw-r--r--shared-bindings/displayio/ParallelBus.c2
-rw-r--r--shared-bindings/displayio/TileGrid.c12
-rw-r--r--shared-bindings/fontio/BuiltinFont.c2
-rw-r--r--shared-bindings/framebufferio/FramebufferDisplay.c10
-rw-r--r--shared-bindings/frequencyio/FrequencyIn.c2
-rw-r--r--shared-bindings/gamepad/GamePad.c2
-rw-r--r--shared-bindings/gnss/GNSS.c2
-rw-r--r--shared-bindings/gnss/PositionFix.c10
-rw-r--r--shared-bindings/gnss/SatelliteSystem.c10
-rw-r--r--shared-bindings/i2cperipheral/I2CPeripheral.c2
-rw-r--r--shared-bindings/microcontroller/RunMode.c6
-rw-r--r--shared-bindings/nvm/ByteArray.c4
-rw-r--r--shared-bindings/ps2io/Ps2.c8
-rw-r--r--shared-bindings/pulseio/PWMOut.c4
-rw-r--r--shared-bindings/pulseio/PulseIn.c4
-rw-r--r--shared-bindings/rgbmatrix/RGBMatrix.c4
-rw-r--r--shared-bindings/rotaryio/IncrementalEncoder.c2
-rwxr-xr-xshared-bindings/supervisor/Runtime.c2
-rw-r--r--shared-bindings/usb_hid/Device.c2
-rw-r--r--shared-bindings/usb_midi/PortIn.c2
-rw-r--r--shared-bindings/usb_midi/PortOut.c2
-rw-r--r--shared-bindings/watchdog/WatchDogMode.c2
-rw-r--r--shared-bindings/watchdog/WatchDogTimer.c2
48 files changed, 116 insertions, 110 deletions
diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c
index 5aab9eca5..4067a2a2a 100644
--- a/shared-bindings/_bleio/Adapter.c
+++ b/shared-bindings/_bleio/Adapter.c
@@ -95,7 +95,7 @@ const mp_obj_property_t bleio_adapter_enabled_obj = {
(mp_obj_t)&mp_const_none_obj },
};
-//| address: str = ...
+//| address: Address = ...
//| """MAC address of the BLE adapter. (read-only)"""
//|
STATIC mp_obj_t bleio_adapter_get_address(mp_obj_t self) {
@@ -350,7 +350,7 @@ const mp_obj_property_t bleio_adapter_connections_obj = {
(mp_obj_t)&mp_const_none_obj },
};
-//| def connect(self, address: Address, *, timeout: float/int) -> Adapter.connect:
+//| def connect(self, address: Address, *, timeout: float/int) -> Connection:
//| """Attempts a connection to the device with the given address.
//|
//| :param Address address: The address of the peripheral to connect to
diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c
index 06fb58d76..144b4c167 100644
--- a/shared-bindings/_bleio/Address.c
+++ b/shared-bindings/_bleio/Address.c
@@ -128,7 +128,7 @@ const mp_obj_property_t bleio_address_type_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| def __eq__(self, other: bytes) -> Optional[bool]:
+//| def __eq__(self, other: Any) -> bool:
//| """Two Address objects are equal if their addresses and address types are equal."""
//| ...
//|
@@ -154,7 +154,7 @@ STATIC mp_obj_t bleio_address_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_o
}
}
-//| def __hash__(self) -> Optional[int]:
+//| def __hash__(self) -> int:
//| """Returns a hash for the Address data."""
//| ...
//|
@@ -187,7 +187,7 @@ STATIC void bleio_address_print(const mp_print_t *print, mp_obj_t self_in, mp_pr
buf[5], buf[4], buf[3], buf[2], buf[1], buf[0]);
}
-//| PUBLIC: bytes = ...
+//| PUBLIC: int = ...
//| """A publicly known address, with a company ID (high 24 bits)and company-assigned part (low 24 bits)."""
//|
//| RANDOM_STATIC: int = ...
diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c
index 64e2baefa..ad63a3c15 100644
--- a/shared-bindings/_bleio/Connection.c
+++ b/shared-bindings/_bleio/Connection.c
@@ -109,7 +109,7 @@ STATIC mp_obj_t bleio_connection_pair(mp_uint_t n_args, const mp_obj_t *pos_args
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_pair_obj, 1, bleio_connection_pair);
-//| def discover_remote_services(self, service_uuids_whitelist: iterable = None) -> Tuple(_bleio.Service, ...):
+//| def discover_remote_services(self, service_uuids_whitelist: iterable = None) -> Service:
//| """Do BLE discovery for all services or for the given service UUIDS,
//| to find their handles and characteristics, and return the discovered services.
//| `Connection.connected` must be True.
diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c
index 7645a25aa..7de79ab63 100644
--- a/shared-bindings/_bleio/PacketBuffer.c
+++ b/shared-bindings/_bleio/PacketBuffer.c
@@ -117,7 +117,7 @@ STATIC mp_obj_t bleio_packet_buffer_readinto(mp_obj_t self_in, mp_obj_t buffer_o
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_packet_buffer_readinto_obj, bleio_packet_buffer_readinto);
-//| def write(self, data: bytes, *, header: bytes = None) -> int:
+//| def write(self, data: bytes, *, header: Optional[bytes] = None) -> int:
//| """Writes all bytes from data into the same outgoing packet. The bytes from header are included
//| before data when the pending packet is currently empty.
//|
diff --git a/shared-bindings/_bleio/ScanEntry.c b/shared-bindings/_bleio/ScanEntry.c
index f8d769cab..561472f5c 100644
--- a/shared-bindings/_bleio/ScanEntry.c
+++ b/shared-bindings/_bleio/ScanEntry.c
@@ -70,7 +70,7 @@ STATIC mp_obj_t bleio_scanentry_matches(mp_uint_t n_args, const mp_obj_t *pos_ar
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_scanentry_matches_obj, 2, bleio_scanentry_matches);
-//| address: _bleio.Address = ...
+//| address: Address = ...
//| """The address of the device (read-only), of type `_bleio.Address`."""
//|
STATIC mp_obj_t bleio_scanentry_get_address(mp_obj_t self_in) {
diff --git a/shared-bindings/_bleio/ScanResults.c b/shared-bindings/_bleio/ScanResults.c
index bc9d55c80..d9620e3fc 100644
--- a/shared-bindings/_bleio/ScanResults.c
+++ b/shared-bindings/_bleio/ScanResults.c
@@ -50,11 +50,11 @@ STATIC mp_obj_t scanresults_iternext(mp_obj_t self_in) {
//| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`."""
//| ...
//|
-//| def __iter__(self) -> __iter__:
+//| def __iter__(self) -> Iterator[ScanEntry]:
//| """Returns itself since it is the iterator."""
//| ...
//|
-//| def __next__(self) -> _bleio.ScanEntry:
+//| def __next__(self) -> ScanEntry:
//| """Returns the next `_bleio.ScanEntry`. Blocks if none have been received and scanning is still
//| active. Raises `StopIteration` if scanning is finished and no other results are available."""
//| ...
diff --git a/shared-bindings/_bleio/Service.c b/shared-bindings/_bleio/Service.c
index 5cda11de4..d2033c60c 100644
--- a/shared-bindings/_bleio/Service.c
+++ b/shared-bindings/_bleio/Service.c
@@ -73,7 +73,7 @@ STATIC mp_obj_t bleio_service_make_new(const mp_obj_type_t *type, size_t n_args,
return MP_OBJ_FROM_PTR(service);
}
-//| characteristics: Tuple(Characteristic, ...) = ...
+//| characteristics: Tuple[Characteristic, ...] = ...
//| """A tuple of :py:class:`Characteristic` designating the characteristics that are offered by
//| this service. (read-only)"""
//|
diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c
index 823275f90..90a39e5e5 100644
--- a/shared-bindings/_bleio/UUID.c
+++ b/shared-bindings/_bleio/UUID.c
@@ -36,7 +36,7 @@
//| class UUID:
//| """A 16-bit or 128-bit UUID. Can be used for services, characteristics, descriptors and more."""
//|
-//| def __init__(self, value: Union[int, typing.ByteString]):
+//| def __init__(self, value: Union[int, ReadableBuffer, str]):
//| """Create a new UUID or UUID object encapsulating the uuid value.
//| The value can be one of:
//|
@@ -248,7 +248,7 @@ STATIC mp_obj_t bleio_uuid_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
}
}
-//| def __eq__(self, other: UUID) -> Optional[bool]:
+//| def __eq__(self, other: Any) -> bool:
//| """Two UUID objects are equal if their values match and they are both 128-bit or both 16-bit."""
//| ...
//|
diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c
index 8778e94ed..4aeb7b460 100644
--- a/shared-bindings/_bleio/__init__.c
+++ b/shared-bindings/_bleio/__init__.c
@@ -59,10 +59,9 @@
//|
-//| class BluetoothError:
-//| def __init__(self, Exception: Exception):
-//| """Catch all exception for Bluetooth related errors."""
-//| ...
+//| class BluetoothError(Exception):
+//| """Catch all exception for Bluetooth related errors."""
+//| ...
MP_DEFINE_BLEIO_EXCEPTION(BluetoothError, Exception)
NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) {
@@ -72,10 +71,9 @@ NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...)
va_end(argptr);
nlr_raise(exception);
}
-//| class ConnectionError:
-//| def __init__(self, BluetoothError: _bleio.BluetoothError):
-//| """Raised when a connection is unavailable."""
-//| ...
+//| class ConnectionError(BluetoothError):
+//| """Raised when a connection is unavailable."""
+//| ...
//|
MP_DEFINE_BLEIO_EXCEPTION(ConnectionError, bleio_BluetoothError)
NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ...) {
@@ -86,20 +84,18 @@ NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ...
nlr_raise(exception);
}
-//| class RoleError:
-//| def __init__(self, BluetoothError: _bleio.BluetoothError):
-//| """Raised when a resource is used as the mismatched role. For example, if a local CCCD is
-//| attempted to be set but they can only be set when remote."""
-//| ...
+//| class RoleError(BluetoothError):
+//| """Raised when a resource is used as the mismatched role. For example, if a local CCCD is
+//| attempted to be set but they can only be set when remote."""
+//| ...
//|
MP_DEFINE_BLEIO_EXCEPTION(RoleError, bleio_BluetoothError)
NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg) {
mp_raise_msg(&mp_type_bleio_RoleError, msg);
}
-//| class SecurityError:
-//| def __init__(self, BluetoothError: _bleio.BluetoothError):
-//| """Raised when a security related error occurs."""
-//| ...
+//| class SecurityError(BluetoothError):
+//| """Raised when a security related error occurs."""
+//| ...
//|
MP_DEFINE_BLEIO_EXCEPTION(SecurityError, bleio_BluetoothError)
NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* fmt, ...) {
diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c
index 8a329147b..e4ba77ed4 100644
--- a/shared-bindings/_eve/__init__.c
+++ b/shared-bindings/_eve/__init__.c
@@ -58,7 +58,7 @@ STATIC mp_obj_t _register(mp_obj_t self, mp_obj_t o) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(register_obj, _register);
-//| def flush(self) -> Any:
+//| def flush(self) -> None:
//| """Send any queued drawing commands directly to the hardware.
//|
//| :param int width: The width of the grid in tiles, or 1 for sprites."""
@@ -559,9 +559,9 @@ STATIC mp_obj_t _colorrgb(size_t n_args, const mp_obj_t *args) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(colorrgb_obj, 4, 4, _colorrgb);
-//| def Display(self) -> Any: ...
-//| """End the display list"""
-//|
+//| def Display(self) -> None:
+//| """End the display list"""
+//| ...
STATIC mp_obj_t _display(mp_obj_t self) {
@@ -570,7 +570,7 @@ STATIC mp_obj_t _display(mp_obj_t self) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(display_obj, _display);
-//| def End(self) -> Any:
+//| def End(self) -> None:
//| """End drawing a graphics primitive
//|
//| :meth:`Vertex2ii` and :meth:`Vertex2f` calls are ignored until the next :meth:`Begin`."""
@@ -628,7 +628,7 @@ STATIC mp_obj_t _macro(mp_obj_t self, mp_obj_t a0) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(macro_obj, _macro);
-//| def Nop(self) -> Any:
+//| def Nop(self) -> None:
//| """No operation"""
//| ...
//|
@@ -672,7 +672,7 @@ STATIC mp_obj_t _pointsize(mp_obj_t self, mp_obj_t a0) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(pointsize_obj, _pointsize);
-//| def RestoreContext(self) -> Any:
+//| def RestoreContext(self) -> None:
//| """Restore the current graphics context from the context stack"""
//| ...
//|
@@ -684,7 +684,7 @@ STATIC mp_obj_t _restorecontext(mp_obj_t self) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(restorecontext_obj, _restorecontext);
-//| def Return(self) -> Any:
+//| def Return(self) -> None:
//| """Return from a previous call command"""
//| ...
//|
@@ -696,7 +696,7 @@ STATIC mp_obj_t _return(mp_obj_t self) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(return_obj, _return);
-//| def SaveContext(self) -> Any:
+//| def SaveContext(self) -> None:
//| """Push the current graphics context on the context stack"""
//| ...
//|
diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c
index 313389ad8..c29f7f322 100644
--- a/shared-bindings/_pew/PewPew.c
+++ b/shared-bindings/_pew/PewPew.c
@@ -46,7 +46,7 @@
//| that library."""
//|
-//| def __init__(self, buffer: ReadableBuffer, rows: List[DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput], cols: List[DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput], buttons: DigitalInputOutput):
+//| def __init__(self, buffer: ReadableBuffer, rows: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], cols: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], buttons: DigitalInOut):
//| """Initializes matrix scanning routines.
//|
//| The ``buffer`` is a 64 byte long ``bytearray`` that stores what should
diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c
index f66b73fdf..81bbc0802 100644
--- a/shared-bindings/_pixelbuf/PixelBuf.c
+++ b/shared-bindings/_pixelbuf/PixelBuf.c
@@ -257,7 +257,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_show(mp_obj_t self_in) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_pixelbuf_show_obj, pixelbuf_pixelbuf_show);
-//| def fill(color: tuple[int, int, int]) -> None:
+//| def fill(color: Union[int, Tuple[int, int, int]]) -> None:
//| """Fills the given pixelbuf with the given color."""
//| ...
//|
diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c
index df6d0c567..e580be38b 100644
--- a/shared-bindings/aesio/aes.c
+++ b/shared-bindings/aesio/aes.c
@@ -12,7 +12,7 @@
//| class AES:
//| """Encrypt and decrypt AES streams"""
//|
-//| def __init__(self, key: ReadableBuffer, mode: int=0, iv: ReadableBuffer=None, segment_size: int=8) -> AES:
+//| def __init__(self, key: Optional[ReadableBuffer], mode: int=0, iv: ReadableBuffer=None, segment_size: int=8) -> None:
//| """Create a new AES state with the given key.
//|
//| :param bytearray key: A 16-, 24-, or 32-byte key
@@ -152,7 +152,7 @@ STATIC void validate_length(aesio_aes_obj_t *self, size_t src_length,
}
}
-//| def encrypt_into(src: WriteableBuffer, dest: WriteableBuffer) -> None:
+//| def encrypt_into(src: ReadableBuffer, dest: WriteableBuffer) -> None:
//| """Encrypt the buffer from ``src`` into ``dest``.
//|
//| 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,
STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_encrypt_into_obj,
aesio_aes_encrypt_into);
-//| def decrypt_into(src: WriteableBuffer, dest: WriteableBuffer) -> None:
+//| def decrypt_into(src: ReadableBuffer, dest: WriteableBuffer) -> None:
//|
//| """Decrypt the buffer from ``src`` into ``dest``.
//| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the
diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c
index 5d1c4f595..bf08d14ce 100644
--- a/shared-bindings/audiobusio/I2SOut.c
+++ b/shared-bindings/audiobusio/I2SOut.c
@@ -147,7 +147,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: Union[audiocore.WaveFile, audiocore.RawSample, audiomixe.Mixer], *, loop: bool = False) -> None:
+//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer], *, loop: bool = False) -> None:
//| """Plays the sample once when loop=False and continuously when loop=True.
//| Does not block. Use `playing` to block.
//|
diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c
index 838447f2e..b31a110c6 100644
--- a/shared-bindings/audiocore/WaveFile.c
+++ b/shared-bindings/audiocore/WaveFile.c
@@ -125,7 +125,7 @@ STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *arg
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_wavefile___exit___obj, 4, 4, audioio_wavefile_obj___exit__);
-//| sample_rate: Optional[int] = ...
+//| sample_rate: int = ...
//| """32 bit value that dictates how quickly samples are loaded into the DAC
//| in Hertz (cycles per second). When the sample is looped, this can change
//| the pitch output without changing the underlying sample."""
diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c
index dc08a1126..a31953e03 100644
--- a/shared-bindings/audiomixer/Mixer.c
+++ b/shared-bindings/audiomixer/Mixer.c
@@ -190,7 +190,7 @@ const mp_obj_property_t audiomixer_mixer_sample_rate_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| voice: Tuple[audiomixer.MixerVoice, ...] = ...
+//| voice: Tuple[MixerVoice, ...] = ...
//| """A tuple of the mixer's `audiomixer.MixerVoice` object(s).
//|
//| .. code-block:: python
diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c
index cb313e0fb..f94d8f176 100644
--- a/shared-bindings/audiomixer/MixerVoice.c
+++ b/shared-bindings/audiomixer/MixerVoice.c
@@ -56,7 +56,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: Union[audiocore.WaveFile, audiomixer.Mixer, audiocore.RawSample], *, loop: bool = False) -> None:
+//| def play(self, sample: Union[audiocore.WaveFile, Mixer, audiocore.RawSample], *, loop: bool = False) -> None:
//| """Plays the sample once when ``loop=False``, and continuously when ``loop=True``.
//| Does not block. Use `playing` to block.
//|
diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c
index 68c27169f..46e6c81f0 100644
--- a/shared-bindings/audiomp3/MP3Decoder.c
+++ b/shared-bindings/audiomp3/MP3Decoder.c
@@ -124,7 +124,7 @@ STATIC mp_obj_t audiomp3_mp3file_obj___exit__(size_t n_args, const mp_obj_t *arg
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomp3_mp3file___exit___obj, 4, 4, audiomp3_mp3file_obj___exit__);
-//| file: Optional[file] = ...
+//| file: file = ...
//| """File to play back."""
//|
STATIC mp_obj_t audiomp3_mp3file_obj_get_file(mp_obj_t self_in) {
@@ -154,7 +154,7 @@ const mp_obj_property_t audiomp3_mp3file_file_obj = {
-//| sample_rate: Optional[int] = ...
+//| sample_rate: int = ...
//| """32 bit value that dictates how quickly samples are loaded into the DAC
//| in Hertz (cycles per second). When the sample is looped, this can change
//| the pitch output without changing the underlying sample."""
diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c
index 38c1bcc0e..a40c41e6a 100644
--- a/shared-bindings/busio/SPI.c
+++ b/shared-bindings/busio/SPI.c
@@ -228,7 +228,7 @@ STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock);
-//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: int = None) -> None:
+//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None) -> None:
//| """Write the data contained in ``buffer``. The SPI object must be locked.
//| If the buffer is empty, nothing happens.
//|
@@ -270,7 +270,7 @@ STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_
MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write);
-//| def readinto(self, buffer: bytearray, *, start: int = 0, end: int = None, write_value: int = 0) -> None:
+//| def readinto(self, buffer: bytearray, *, start: int = 0, end: Optional[int] = None, write_value: int = 0) -> None:
//| """Read into ``buffer`` while writing ``write_value`` for each byte read.
//| The SPI object must be locked.
//| If the number of bytes to read is 0, nothing happens.
@@ -314,7 +314,7 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m
}
MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto);
-//| def write_readinto(self, buffer_out: ReadableBuffer, buffer_in: ReadableBuffer, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None:
+//| def write_readinto(self, buffer_out: ReadableBuffer, buffer_in: ReadableBuffer, *, out_start: int = 0, out_end: Optional[int] = None, in_start: int = 0, in_end: Optional[int] = None) -> None:
//| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``.
//| The SPI object must be locked.
//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]``
diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c
index fd51d5d3b..f4f8746fe 100644
--- a/shared-bindings/busio/UART.c
+++ b/shared-bindings/busio/UART.c
@@ -179,7 +179,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_
// These are standard stream methods. Code is in py/stream.c.
//
-//| def read(self, nbytes: int = None) -> Optional[bytes]:
+//| def read(self, nbytes: Optional[int] = None) -> Optional[bytes]:
//| """Read characters. If ``nbytes`` is specified then read at most that many
//| bytes. Otherwise, read everything that arrives until the connection
//| times out. Providing the number of bytes expected is highly recommended
diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c
index c3ddc6c14..e2e648876 100644
--- a/shared-bindings/displayio/Display.c
+++ b/shared-bindings/displayio/Display.c
@@ -49,7 +49,7 @@
//| Most people should not use this class directly. Use a specific display driver instead that will
//| contain the initialization sequence at minimum."""
//|
-//| def __init__(self, display_bus: displayio, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: microcontroller.Pin = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60):
+//| def __init__(self, display_bus: displayio, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: Optional[microcontroller.Pin] = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60):
//| r"""Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`).
//|
//| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a
@@ -372,7 +372,7 @@ const mp_obj_property_t displayio_display_height_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| rotation: Optional[int] = ...
+//| rotation: int = ...
//| """The rotation of the display as an int in degrees."""
//|
STATIC mp_obj_t displayio_display_obj_get_rotation(mp_obj_t self_in) {
diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c
index e5768572e..b9f7dd9a1 100644
--- a/shared-bindings/displayio/EPaperDisplay.c
+++ b/shared-bindings/displayio/EPaperDisplay.c
@@ -49,7 +49,7 @@
//| Most people should not use this class directly. Use a specific display driver instead that will
//| contain the startup and shutdown sequences at minimum."""
//|
-//| def __init__(self, display_bus: displayio, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: int = None, set_row_window_command: int = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: int = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: microcontroller.Pin = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False):
+//| def __init__(self, display_bus: displayio, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: Optional[int] = None, set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: Optional[int] = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False):
//| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`).
//|
//| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every
diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c
index d81bf5fdb..9d12ca161 100644
--- a/shared-bindings/displayio/Group.c
+++ b/shared-bindings/displayio/Group.c
@@ -86,7 +86,7 @@ displayio_group_t* native_group(mp_obj_t group_obj) {
return MP_OBJ_TO_PTR(native_group);
}
-//| hidden: Optional[bool] = ...
+//| hidden: bool = ...
//| """True when the Group and all of it's layers are not visible. When False, the Group's layers
//| are visible if they haven't been hidden."""
//|
@@ -111,7 +111,7 @@ const mp_obj_property_t displayio_group_hidden_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| scale: Optional[int] = ...
+//| scale: int = ...
//| """Scales each pixel within the Group in both directions. For example, when scale=2 each pixel
//| will be represented by 2x2 pixels."""
//|
@@ -140,7 +140,7 @@ const mp_obj_property_t displayio_group_scale_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| x: Optional[int] = ...
+//| x: int = ...
//| """X position of the Group in the parent."""
//|
STATIC mp_obj_t displayio_group_obj_get_x(mp_obj_t self_in) {
@@ -165,7 +165,7 @@ const mp_obj_property_t displayio_group_x_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| y: Optional[int] = ...
+//| y: int = ...
//| """Y position of the Group in the parent."""
//|
STATIC mp_obj_t displayio_group_obj_get_y(mp_obj_t self_in) {
@@ -264,7 +264,9 @@ STATIC mp_obj_t displayio_group_obj_remove(mp_obj_t self_in, mp_obj_t layer) {
}
MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_remove_obj, displayio_group_obj_remove);
-//| def __len__(self) -> Union[bool, int, None]:
+//| def __bool__(self) -> bool: ...
+//|
+//| def __len__(self) -> int:
//| """Returns the number of layers in a Group"""
//| ...
//|
diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c
index 7bca2c36b..7c1827db3 100644
--- a/shared-bindings/displayio/I2CDisplay.c
+++ b/shared-bindings/displayio/I2CDisplay.c
@@ -91,7 +91,7 @@ STATIC mp_obj_t displayio_i2cdisplay_obj_reset(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(displayio_i2cdisplay_reset_obj, displayio_i2cdisplay_obj_reset);
-//| def send(self, command: int, data: displayio) -> None:
+//| def send(self, command: int, data: ReadableBuffer) -> None:
//| """Sends the given command value followed by the full set of data. Display state, such as
//| vertical scroll, set via ``send`` may or may not be reset once the code is done."""
//| ...
diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c
index 4b7756a11..a06dd38ff 100644
--- a/shared-bindings/displayio/Palette.c
+++ b/shared-bindings/displayio/Palette.c
@@ -70,7 +70,9 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a
return MP_OBJ_FROM_PTR(self);
}
-//| def __len__(self) -> Union[bool, int, None]:
+//| def __bool__(self) -> bool: ...
+//|
+//| def __len__(self) -> int:
//| """Returns the number of colors in a Palette"""
//| ...
//|
diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c
index e3897a420..247ac5dd5 100644
--- a/shared-bindings/displayio/ParallelBus.c
+++ b/shared-bindings/displayio/ParallelBus.c
@@ -102,7 +102,7 @@ STATIC mp_obj_t displayio_parallelbus_obj_reset(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(displayio_parallelbus_reset_obj, displayio_parallelbus_obj_reset);
-//| def send(self, command: int, data: displayio) -> None:
+//| def send(self, command: int, data: ReadableBuffer) -> None:
//| """Sends the given command value followed by the full set of data. Display state, such as
//| vertical scroll, set via ``send`` may or may not be reset once the code is done."""
//| ...
diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c
index 9f17f4116..d3ad0f0fc 100644
--- a/shared-bindings/displayio/TileGrid.c
+++ b/shared-bindings/displayio/TileGrid.c
@@ -141,7 +141,7 @@ static displayio_tilegrid_t* native_tilegrid(mp_obj_t tilegrid_obj) {
mp_obj_assert_native_inited(native_tilegrid);
return MP_OBJ_TO_PTR(native_tilegrid);
}
-//| hidden: Optional[bool] = ...
+//| hidden: bool = ...
//| """True when the TileGrid is hidden. This may be False even when a part of a hidden Group."""
//|
STATIC mp_obj_t displayio_tilegrid_obj_get_hidden(mp_obj_t self_in) {
@@ -165,7 +165,7 @@ const mp_obj_property_t displayio_tilegrid_hidden_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| x: Optional[int] = ...
+//| x: int = ...
//| """X position of the left edge in the parent."""
//|
STATIC mp_obj_t displayio_tilegrid_obj_get_x(mp_obj_t self_in) {
@@ -190,7 +190,7 @@ const mp_obj_property_t displayio_tilegrid_x_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| y: Optional[int] = ...
+//| y: int = ...
//| """Y position of the top edge in the parent."""
//|
STATIC mp_obj_t displayio_tilegrid_obj_get_y(mp_obj_t self_in) {
@@ -215,7 +215,7 @@ const mp_obj_property_t displayio_tilegrid_y_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| flip_x: Optional[bool] = ...
+//| flip_x: bool = ...
//| """If true, the left edge rendered will be the right edge of the right-most tile."""
//|
STATIC mp_obj_t displayio_tilegrid_obj_get_flip_x(mp_obj_t self_in) {
@@ -239,7 +239,7 @@ const mp_obj_property_t displayio_tilegrid_flip_x_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| flip_y: Optional[bool] = ...
+//| flip_y: bool = ...
//| """If true, the top edge rendered will be the bottom edge of the bottom-most tile."""
//|
STATIC mp_obj_t displayio_tilegrid_obj_get_flip_y(mp_obj_t self_in) {
@@ -264,7 +264,7 @@ const mp_obj_property_t displayio_tilegrid_flip_y_obj = {
};
-//| transpose_xy: Optional[bool] = ...
+//| transpose_xy: bool = ...
//| """If true, the TileGrid's axis will be swapped. When combined with mirroring, any 90 degree
//| rotation can be achieved along with the corresponding mirrored version."""
//|
diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c
index cc4d50fe2..6d6a39818 100644
--- a/shared-bindings/fontio/BuiltinFont.c
+++ b/shared-bindings/fontio/BuiltinFont.c
@@ -76,7 +76,7 @@ STATIC mp_obj_t fontio_builtinfont_obj_get_bounding_box(mp_obj_t self_in) {
MP_DEFINE_CONST_FUN_OBJ_1(fontio_builtinfont_get_bounding_box_obj, fontio_builtinfont_obj_get_bounding_box);
-//| def get_glyph(self, codepoint: int) -> fontio.Glyph:
+//| def get_glyph(self, codepoint: int) -> Glyph:
//| """Returns a `fontio.Glyph` for the given codepoint or None if no glyph is available."""
//| ...
//|
diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c
index 4bbdf888d..29e11638a 100644
--- a/shared-bindings/framebufferio/FramebufferDisplay.c
+++ b/shared-bindings/framebufferio/FramebufferDisplay.c
@@ -151,7 +151,7 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_refresh(size_t n_args, cons
}
MP_DEFINE_CONST_FUN_OBJ_KW(framebufferio_framebufferdisplay_refresh_obj, 1, framebufferio_framebufferdisplay_obj_refresh);
-//| auto_refresh: Optional[bool] = ...
+//| auto_refresh: bool = ...
//| """True when the display is refreshed automatically."""
//|
STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_auto_refresh(mp_obj_t self_in) {
@@ -176,7 +176,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_auto_refresh_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| brightness: Optional[float] = ...
+//| brightness: float = ...
//| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When
//| `auto_brightness` is True, the value of `brightness` will change automatically.
//| If `brightness` is set, `auto_brightness` will be disabled and will be set to False."""
@@ -213,7 +213,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_brightness_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| auto_brightness: Optional[bool] = ...
+//| auto_brightness: bool = ...
//| """True when the display brightness is adjusted automatically, based on an ambient
//| light sensor or other method. Note that some displays may have this set to True by default,
//| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False
@@ -276,7 +276,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_height_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| rotation: Optional[int] = ...
+//| rotation: int = ...
//| """The rotation of the display as an int in degrees."""
//|
STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_rotation(mp_obj_t self_in) {
@@ -317,7 +317,7 @@ const mp_obj_property_t framebufferio_framebufferframebuffer_obj = {
};
-//| def fill_row(self, y: int, buffer: ReadableBuffer) -> displayio:
+//| def fill_row(self, y: int, buffer: WriteableBuffer) -> displayio:
//| """Extract the pixels from a single row
//|
//| :param int y: The top edge of the area
diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c
index b8b8a0f2d..1aed71f25 100644
--- a/shared-bindings/frequencyio/FrequencyIn.c
+++ b/shared-bindings/frequencyio/FrequencyIn.c
@@ -169,7 +169,7 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_clear(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_clear_obj, frequencyio_frequencyin_obj_clear);
-//| capture_period: Optional[int] = ...
+//| capture_period: int = ...
//| """The capture measurement period. Lower incoming frequencies will be measured
//| more accurately with longer capture periods. Higher frequencies are more
//| accurate with shorter capture periods.
diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c
index a5da83e3e..8c0f58d0e 100644
--- a/shared-bindings/gamepad/GamePad.c
+++ b/shared-bindings/gamepad/GamePad.c
@@ -70,7 +70,7 @@
//| time.sleep(0.1)"""
//|
-//| def __init__(self, b1: DigialInOut, b2: DigialInOut, b3: DigialInOut, b4: DigialInOut, b5: DigialInOut, b6: DigialInOut, b7: DigialInOut, b8: DigialInOut):
+//| def __init__(self, b1: DigitalInOut, b2: DigitalInOut, b3: DigitalInOut, b4: DigitalInOut, b5: DigitalInOut, b6: DigitalInOut, b7: DigitalInOut, b8: DigitalInOut):
//| """Initializes button scanning routines.
//|
//| The ``b1``-``b8`` parameters are ``DigitalInOut`` objects, which
diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c
index 99f2ba5c8..86bf3ca42 100644
--- a/shared-bindings/gnss/GNSS.c
+++ b/shared-bindings/gnss/GNSS.c
@@ -171,7 +171,7 @@ const mp_obj_property_t gnss_altitude_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| timestamp: string = ...
+//| timestamp: time.struct_time = ...
//| """Time when the position data was updated."""
//|
STATIC mp_obj_t gnss_obj_get_timestamp(mp_obj_t self_in) {
diff --git a/shared-bindings/gnss/PositionFix.c b/shared-bindings/gnss/PositionFix.c
index 52c0dd482..9d4c96fe0 100644
--- a/shared-bindings/gnss/PositionFix.c
+++ b/shared-bindings/gnss/PositionFix.c
@@ -32,17 +32,17 @@
//| def __init__(self):
//| """Enum-like class to define the position fix mode."""
//|
-//| INVALID: gnss.PositionFix = ...
+//| INVALID: PositionFix = ...
//| """No measurement.
//|
-//| :type gnss.PositionFix:"""
+//| :type PositionFix:"""
//|
-//| FIX_2D: gnss.PositionFix = ...
+//| FIX_2D: PositionFix = ...
//| """2D fix.
//|
-//| :type gnss.PositionFix:"""
+//| :type PositionFix:"""
//|
-//| FIX_3D: gnss.PositionFix = ...
+//| FIX_3D: PositionFix = ...
//| """3D fix.
//|
//| :type gnss.PositionFix:"""
diff --git a/shared-bindings/gnss/SatelliteSystem.c b/shared-bindings/gnss/SatelliteSystem.c
index 5ee7f0ffb..3405021d4 100644
--- a/shared-bindings/gnss/SatelliteSystem.c
+++ b/shared-bindings/gnss/SatelliteSystem.c
@@ -32,27 +32,27 @@
//| def __init__(self):
//| """Enum-like class to define the satellite system type."""
//|
-//| GPS: gnss.SatelliteSystem = ...
+//| GPS: SatelliteSystem = ...
//| """Global Positioning System.
//|
//| :type gnss.SatelliteSystem:"""
//|
-//| GLONASS: gnss.SatelliteSystem = ...
+//| GLONASS: SatelliteSystem = ...
//| """GLObal NAvigation Satellite System.
//|
//| :type gnss.SatelliteSystem:"""
//|
-//| SBAS: gnss.SatelliteSystem = ...
+//| SBAS: SatelliteSystem = ...
//| """Satellite Based Augmentation System.
//|
//| :type gnss.SatelliteSystem:"""
//|
-//| QZSS_L1CA: gnss.SatelliteSystem = ...
+//| QZSS_L1CA: SatelliteSystem = ...
//| """Quasi-Zenith Satellite System L1C/A.
//|
//| :type gnss.SatelliteSystem:"""
//|
-//| QZSS_L1S: gnss.SatelliteSystem = ...
+//| QZSS_L1S: SatelliteSystem = ...
//| """Quasi-Zenith Satellite System L1S.
//|
//| :type gnss.SatelliteSystem:"""
diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2cperipheral/I2CPeripheral.c
index 55094f75c..0a1c798ab 100644
--- a/shared-bindings/i2cperipheral/I2CPeripheral.c
+++ b/shared-bindings/i2cperipheral/I2CPeripheral.c
@@ -133,7 +133,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj___exit__(size_t n_args, const m
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_obj___exit__);
-//| def request(self, timeout: float = -1) -> i2cperipheral.I2CPeripheralRequest:
+//| def request(self, timeout: float = -1) -> I2CPeripheralRequest:
//| """Wait for an I2C request.
//|
//| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once
diff --git a/shared-bindings/microcontroller/RunMode.c b/shared-bindings/microcontroller/RunMode.c
index dce7a5230..f133c34b1 100644
--- a/shared-bindings/microcontroller/RunMode.c
+++ b/shared-bindings/microcontroller/RunMode.c
@@ -33,18 +33,18 @@
//| """Enum-like class to define the run mode of the microcontroller and
//| CircuitPython."""
//|
-//| NORMAL: microcontroller.RunMode = ...
+//| NORMAL: RunMode = ...
//| """Run CircuitPython as normal.
//|
//| :type microcontroller.RunMode:"""
//|
-//| SAFE_MODE: microcontroller.RunMode = ...
+//| SAFE_MODE: RunMode = ...
//| """Run CircuitPython in safe mode. User code will not be run and the
//| file system will be writeable over USB.
//|
//| :type microcontroller.RunMode:"""
//|
-//| BOOTLOADER: microcontroller.RunMode = ...
+//| BOOTLOADER: RunMode = ...
//| """Run the bootloader.
//|
//| :type microcontroller.RunMode:"""
diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c
index b30582f66..6f282d697 100644
--- a/shared-bindings/nvm/ByteArray.c
+++ b/shared-bindings/nvm/ByteArray.c
@@ -49,7 +49,9 @@
//| ...
//|
-//| def __len__(self) -> Union[bool, int, None]:
+//| def __bool__(self) -> bool: ...
+//|
+//| def __len__(self) -> int:
//| """Return the length. This is used by (`len`)"""
//| ...
//|
diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c
index b4a741030..a7f1d9da5 100644
--- a/shared-bindings/ps2io/Ps2.c
+++ b/shared-bindings/ps2io/Ps2.c
@@ -122,7 +122,7 @@ STATIC mp_obj_t ps2io_ps2_obj___exit__(size_t n_args, const mp_obj_t *args) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ps2io_ps2___exit___obj, 4, 4, ps2io_ps2_obj___exit__);
-//| def popleft(self) -> byte:
+//| def popleft(self) -> int:
//| """Removes and returns the oldest received byte. When buffer
//| is empty, raises an IndexError exception."""
//| ...
@@ -164,7 +164,7 @@ STATIC mp_obj_t ps2io_ps2_obj_sendcmd(mp_obj_t self_in, mp_obj_t ob) {
}
MP_DEFINE_CONST_FUN_OBJ_2(ps2io_ps2_sendcmd_obj, ps2io_ps2_obj_sendcmd);
-//| def clear_errors(self) -> int:
+//| def clear_errors(self) -> None:
//| """Returns and clears a bitmap with latest recorded communication errors.
//|
//| Reception errors (arise asynchronously, as data is received):
@@ -202,7 +202,9 @@ STATIC mp_obj_t ps2io_ps2_obj_clear_errors(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(ps2io_ps2_clear_errors_obj, ps2io_ps2_obj_clear_errors);
-//| def __len__(self) -> Union[bool, int, None]:
+//| def __bool__(self) -> bool: ...
+//|
+//| def __len__(self) -> int:
//| """Returns the number of received bytes in buffer, available
//| to :py:func:`popleft()`."""
//| ...
diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c
index 4197a5251..862a500bf 100644
--- a/shared-bindings/pulseio/PWMOut.c
+++ b/shared-bindings/pulseio/PWMOut.c
@@ -150,7 +150,7 @@ STATIC mp_obj_t pulseio_pwmout_obj___exit__(size_t n_args, const mp_obj_t *args)
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pwmout___exit___obj, 4, 4, pulseio_pwmout_obj___exit__);
-//| duty_cycle: Optional[int] = ...
+//| duty_cycle: int = ...
//| """16 bit value that dictates how much of one cycle is high (1) versus low
//| (0). 0xffff will always be high, 0 will always be low and 0x7fff will
//| be half high and then half low.
@@ -186,7 +186,7 @@ const mp_obj_property_t pulseio_pwmout_duty_cycle_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| frequency: Optional[int] = ...
+//| frequency: int = ...
//| """32 bit value that dictates the PWM frequency in Hertz (cycles per
//| second). Only writeable when constructed with ``variable_frequency=True``.
//|
diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c
index d83306eab..75ea1a80e 100644
--- a/shared-bindings/pulseio/PulseIn.c
+++ b/shared-bindings/pulseio/PulseIn.c
@@ -234,7 +234,9 @@ const mp_obj_property_t pulseio_pulsein_paused_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| def __len__(self) -> Union[bool, int, None]:
+//| def __bool__(self) -> bool: ...
+//|
+//| def __len__(self) -> int:
//| """Returns the current pulse length
//|
//| This allows you to::
diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c
index decf94f67..0099d9f0c 100644
--- a/shared-bindings/rgbmatrix/RGBMatrix.c
+++ b/shared-bindings/rgbmatrix/RGBMatrix.c
@@ -128,7 +128,7 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_
}
}
-//| def __init__(self, *, width: int, bit_depth: List[digitalio.DigitalInOut], rgb_pins: List[digitalio.DigitalInOut], addr_pins: List[digitalio.DigitalInOut], clock_pin: digitalio.DigitalInOut, latch_pin: digitalio.DigitalInOut, output_enable_pin: digitalio.DigitalInOut, doublebuffer: bool = True, framebuffer: WriteableBuffer = None, height: int = 0):
+//| def __init__(self, *, width: int, bit_depth: List[digitalio.DigitalInOut], rgb_pins: List[digitalio.DigitalInOut], addr_pins: List[digitalio.DigitalInOut], clock_pin: digitalio.DigitalInOut, latch_pin: digitalio.DigitalInOut, output_enable_pin: digitalio.DigitalInOut, doublebuffer: bool = True, framebuffer: Optional[WriteableBuffer] = None, height: int = 0):
//| """Create a RGBMatrix object with the given attributes. The height of
//| the display is determined by the number of rgb and address pins:
//| len(rgb_pins) // 3 * 2 ** len(address_pins). With 6 RGB pins and 4
@@ -257,7 +257,7 @@ static void check_for_deinit(rgbmatrix_rgbmatrix_obj_t *self) {
}
}
-//| brightness: Optional[float] = ...
+//| brightness: float = ...
//| """In the current implementation, 0.0 turns the display off entirely
//| and any other value up to 1.0 turns the display on fully."""
//|
diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c
index 26a50dde9..201336266 100644
--- a/shared-bindings/rotaryio/IncrementalEncoder.c
+++ b/shared-bindings/rotaryio/IncrementalEncoder.c
@@ -116,7 +116,7 @@ STATIC mp_obj_t rotaryio_incrementalencoder_obj___exit__(size_t n_args, const mp
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(rotaryio_incrementalencoder___exit___obj, 4, 4, rotaryio_incrementalencoder_obj___exit__);
-//| position: Optional[int] = ...
+//| position: int = ...
//| """The current position in terms of pulses. The number of pulses per rotation is defined by the
//| specific hardware."""
//|
diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c
index e0bd07600..ba72bcd03 100755
--- a/shared-bindings/supervisor/Runtime.c
+++ b/shared-bindings/supervisor/Runtime.c
@@ -39,7 +39,7 @@
//| print("Hello World!")"""
//|
-//| def __init__(self):
+//| def __init__(self): -> None
//| """You cannot create an instance of `supervisor.Runtime`.
//| Use `supervisor.runtime` to access the sole instance available."""
//| ...
diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c
index 14b441e44..f7323accf 100644
--- a/shared-bindings/usb_hid/Device.c
+++ b/shared-bindings/usb_hid/Device.c
@@ -39,7 +39,7 @@
//| mouse.send_report()"""
//|
-//| def __init__(self):
+//| def __init__(self): -> None
//| """Not currently dynamically supported."""
//| ...
//|
diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c
index 176283cd5..62c4f98e8 100644
--- a/shared-bindings/usb_midi/PortIn.c
+++ b/shared-bindings/usb_midi/PortIn.c
@@ -58,7 +58,7 @@
//| :rtype: bytes or None"""
//| ...
//|
-//| def readinto(self, buf: WriteableBuffer, nbytes: int = None) -> Optional[bytes]:
+//| def readinto(self, buf: WriteableBuffer, nbytes: Optional[int] = None) -> Optional[bytes]:
//| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most
//| that many bytes. Otherwise, read at most ``len(buf)`` bytes.
//|
diff --git a/shared-bindings/usb_midi/PortOut.c b/shared-bindings/usb_midi/PortOut.c
index 92ed451e9..e820c0a36 100644
--- a/shared-bindings/usb_midi/PortOut.c
+++ b/shared-bindings/usb_midi/PortOut.c
@@ -38,7 +38,7 @@
//| class PortOut:
//| """Sends midi messages to a computer over USB"""
//|
-//| def __init__(self):
+//| def __init__(self): -> None
//| """You cannot create an instance of `usb_midi.PortOut`.
//|
//| PortOut objects are constructed for every corresponding entry in the USB
diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c
index d867ba524..6c3a70c1e 100644
--- a/shared-bindings/watchdog/WatchDogMode.c
+++ b/shared-bindings/watchdog/WatchDogMode.c
@@ -29,7 +29,7 @@
//| class WatchDogMode:
//| """run state of the watchdog timer"""
//|
-//| def __init__(self):
+//| def __init__(self): -> None
//| """Enum-like class to define the run mode of the watchdog timer."""
//|
//| RAISE: watchdog.WatchDogMode = ...
diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c
index 4a2aa00cd..ba1e43b35 100644
--- a/shared-bindings/watchdog/WatchDogTimer.c
+++ b/shared-bindings/watchdog/WatchDogTimer.c
@@ -49,7 +49,7 @@
//| """
//|
-//| def __init__(self):
+//| def __init__(self): -> None
//| """Not currently dynamically supported. Access the sole instance through `microcontroller.watchdog`."""
//| ...
//|