From 54cb1feea04c0c93afe40868bc050ff7f645c61e Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 13:28:36 -0400 Subject: Removed all 'self, )' --- shared-bindings/microcontroller/RunMode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shared-bindings/microcontroller/RunMode.c') diff --git a/shared-bindings/microcontroller/RunMode.c b/shared-bindings/microcontroller/RunMode.c index 6db315d8d..d4c10109a 100644 --- a/shared-bindings/microcontroller/RunMode.c +++ b/shared-bindings/microcontroller/RunMode.c @@ -29,7 +29,7 @@ //| class RunMode: //| """run state of the microcontroller""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Enum-like class to define the run mode of the microcontroller and //| CircuitPython.""" //| -- cgit v1.2.3 From 0a8d9eed45422936bfa6df58d79ac2b4a855ca90 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:33:28 -0400 Subject: Added type hints to microcontroller --- shared-bindings/microcontroller/Processor.c | 6 +++--- shared-bindings/microcontroller/RunMode.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'shared-bindings/microcontroller/RunMode.c') diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index c3c60d5cc..32ec4f2e7 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -67,7 +67,7 @@ const mp_obj_property_t mcu_processor_frequency_obj = { }, }; -//| temperature: Any = ... +//| temperature: Optional[float] = ... //| """The on-chip temperature, in Celsius, as a float. (read-only) //| //| Is `None` if the temperature is not available.""" @@ -87,7 +87,7 @@ const mp_obj_property_t mcu_processor_temperature_obj = { }, }; -//| uid: Any = ... +//| uid: bytearray = ... //| """The unique id (aka serial number) of the chip as a `bytearray`. (read-only)""" //| STATIC mp_obj_t mcu_processor_get_uid(mp_obj_t self) { @@ -106,7 +106,7 @@ const mp_obj_property_t mcu_processor_uid_obj = { }, }; -//| voltage: Any = ... +//| voltage: Optional[float] = ... //| """The input voltage to the microcontroller, as a float. (read-only) //| //| Is `None` if the voltage is not available.""" diff --git a/shared-bindings/microcontroller/RunMode.c b/shared-bindings/microcontroller/RunMode.c index d4c10109a..dce7a5230 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: Any = ... +//| NORMAL: microcontroller.RunMode = ... //| """Run CircuitPython as normal. //| //| :type microcontroller.RunMode:""" //| -//| SAFE_MODE: Any = ... +//| SAFE_MODE: microcontroller.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: Any = ... +//| BOOTLOADER: microcontroller.RunMode = ... //| """Run the bootloader. //| //| :type microcontroller.RunMode:""" -- cgit v1.2.3 From 3df03a565069d6e8874eb678d4f010eee97305b0 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 13:49:00 -0400 Subject: Made most of the requested changes --- shared-bindings/_bleio/Adapter.c | 4 +-- shared-bindings/_bleio/Address.c | 6 ++--- shared-bindings/_bleio/Connection.c | 2 +- shared-bindings/_bleio/PacketBuffer.c | 2 +- shared-bindings/_bleio/ScanEntry.c | 2 +- shared-bindings/_bleio/ScanResults.c | 4 +-- shared-bindings/_bleio/Service.c | 2 +- shared-bindings/_bleio/UUID.c | 4 +-- shared-bindings/_bleio/__init__.c | 30 ++++++++++------------ shared-bindings/_eve/__init__.c | 18 ++++++------- shared-bindings/_pew/PewPew.c | 2 +- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- shared-bindings/aesio/aes.c | 6 ++--- shared-bindings/audiobusio/I2SOut.c | 2 +- shared-bindings/audiocore/WaveFile.c | 2 +- shared-bindings/audiomixer/Mixer.c | 2 +- shared-bindings/audiomixer/MixerVoice.c | 2 +- shared-bindings/audiomp3/MP3Decoder.c | 4 +-- shared-bindings/busio/SPI.c | 6 ++--- shared-bindings/busio/UART.c | 2 +- shared-bindings/displayio/Display.c | 4 +-- shared-bindings/displayio/EPaperDisplay.c | 2 +- shared-bindings/displayio/Group.c | 12 +++++---- shared-bindings/displayio/I2CDisplay.c | 2 +- shared-bindings/displayio/Palette.c | 4 ++- shared-bindings/displayio/ParallelBus.c | 2 +- shared-bindings/displayio/TileGrid.c | 12 ++++----- shared-bindings/fontio/BuiltinFont.c | 2 +- shared-bindings/framebufferio/FramebufferDisplay.c | 10 ++++---- shared-bindings/frequencyio/FrequencyIn.c | 2 +- shared-bindings/gamepad/GamePad.c | 2 +- shared-bindings/gnss/GNSS.c | 2 +- shared-bindings/gnss/PositionFix.c | 10 ++++---- shared-bindings/gnss/SatelliteSystem.c | 10 ++++---- shared-bindings/i2cperipheral/I2CPeripheral.c | 2 +- shared-bindings/microcontroller/RunMode.c | 6 ++--- shared-bindings/nvm/ByteArray.c | 4 ++- shared-bindings/ps2io/Ps2.c | 8 +++--- shared-bindings/pulseio/PWMOut.c | 4 +-- shared-bindings/pulseio/PulseIn.c | 4 ++- shared-bindings/rgbmatrix/RGBMatrix.c | 4 +-- shared-bindings/rotaryio/IncrementalEncoder.c | 2 +- shared-bindings/supervisor/Runtime.c | 2 +- shared-bindings/usb_hid/Device.c | 2 +- shared-bindings/usb_midi/PortIn.c | 2 +- shared-bindings/usb_midi/PortOut.c | 2 +- shared-bindings/watchdog/WatchDogMode.c | 2 +- shared-bindings/watchdog/WatchDogTimer.c | 2 +- 48 files changed, 116 insertions(+), 110 deletions(-) (limited to 'shared-bindings/microcontroller/RunMode.c') 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`.""" //| ... //| -- cgit v1.2.3 From d0d949cd24dbff5fb382f8c7abf3bae7ba46541a Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 14:23:34 -0400 Subject: Made every init return None --- shared-bindings/_bleio/Adapter.c | 2 +- shared-bindings/_bleio/Address.c | 2 +- shared-bindings/_bleio/Attribute.c | 2 +- shared-bindings/_bleio/Characteristic.c | 2 +- shared-bindings/_bleio/CharacteristicBuffer.c | 2 +- shared-bindings/_bleio/Connection.c | 2 +- shared-bindings/_bleio/Descriptor.c | 2 +- shared-bindings/_bleio/PacketBuffer.c | 2 +- shared-bindings/_bleio/ScanEntry.c | 2 +- shared-bindings/_bleio/ScanResults.c | 2 +- shared-bindings/_bleio/Service.c | 2 +- shared-bindings/_bleio/UUID.c | 2 +- shared-bindings/_pew/PewPew.c | 2 +- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- shared-bindings/_stage/Layer.c | 2 +- shared-bindings/_stage/Text.c | 2 +- shared-bindings/analogio/AnalogIn.c | 2 +- shared-bindings/analogio/AnalogOut.c | 2 +- shared-bindings/audiobusio/I2SOut.c | 2 +- shared-bindings/audiobusio/PDMIn.c | 2 +- shared-bindings/audiocore/RawSample.c | 2 +- shared-bindings/audiocore/WaveFile.c | 2 +- shared-bindings/audioio/AudioOut.c | 2 +- shared-bindings/audiomixer/Mixer.c | 2 +- shared-bindings/audiomixer/MixerVoice.c | 2 +- shared-bindings/audiomp3/MP3Decoder.c | 2 +- shared-bindings/audiopwmio/PWMAudioOut.c | 2 +- shared-bindings/bitbangio/I2C.c | 2 +- shared-bindings/bitbangio/OneWire.c | 2 +- shared-bindings/bitbangio/SPI.c | 2 +- shared-bindings/busio/I2C.c | 2 +- shared-bindings/busio/OneWire.c | 2 +- shared-bindings/busio/SPI.c | 2 +- shared-bindings/busio/UART.c | 2 +- shared-bindings/countio/Counter.c | 2 +- shared-bindings/digitalio/DigitalInOut.c | 2 +- shared-bindings/digitalio/Direction.c | 2 +- shared-bindings/digitalio/DriveMode.c | 2 +- shared-bindings/digitalio/Pull.c | 2 +- shared-bindings/displayio/Bitmap.c | 2 +- shared-bindings/displayio/ColorConverter.c | 2 +- shared-bindings/displayio/Display.c | 2 +- shared-bindings/displayio/EPaperDisplay.c | 2 +- shared-bindings/displayio/FourWire.c | 2 +- shared-bindings/displayio/Group.c | 2 +- shared-bindings/displayio/I2CDisplay.c | 2 +- shared-bindings/displayio/OnDiskBitmap.c | 2 +- shared-bindings/displayio/Palette.c | 2 +- shared-bindings/displayio/ParallelBus.c | 2 +- shared-bindings/displayio/Shape.c | 2 +- shared-bindings/displayio/TileGrid.c | 2 +- shared-bindings/fontio/BuiltinFont.c | 2 +- shared-bindings/framebufferio/FramebufferDisplay.c | 2 +- shared-bindings/frequencyio/FrequencyIn.c | 2 +- shared-bindings/gamepad/GamePad.c | 2 +- shared-bindings/gamepadshift/GamePadShift.c | 2 +- shared-bindings/gnss/GNSS.c | 2 +- shared-bindings/gnss/PositionFix.c | 2 +- shared-bindings/gnss/SatelliteSystem.c | 2 +- shared-bindings/i2cperipheral/I2CPeripheral.c | 4 ++-- shared-bindings/microcontroller/Pin.c | 2 +- shared-bindings/microcontroller/Processor.c | 2 +- shared-bindings/microcontroller/RunMode.c | 2 +- shared-bindings/nvm/ByteArray.c | 2 +- shared-bindings/ps2io/Ps2.c | 2 +- shared-bindings/pulseio/PWMOut.c | 2 +- shared-bindings/pulseio/PulseIn.c | 2 +- shared-bindings/pulseio/PulseOut.c | 2 +- shared-bindings/rgbmatrix/RGBMatrix.c | 2 +- shared-bindings/rotaryio/IncrementalEncoder.c | 2 +- shared-bindings/rtc/RTC.c | 2 +- shared-bindings/sdcardio/SDCard.c | 2 +- shared-bindings/sdioio/SDCard.c | 2 +- shared-bindings/socket/__init__.c | 2 +- shared-bindings/storage/__init__.c | 2 +- shared-bindings/terminalio/Terminal.c | 2 +- shared-bindings/time/__init__.c | 2 +- shared-bindings/touchio/TouchIn.c | 2 +- shared-bindings/ulab/__init__.pyi | 2 +- shared-bindings/usb_midi/PortIn.c | 2 +- shared-bindings/vectorio/Circle.c | 2 +- shared-bindings/vectorio/Polygon.c | 2 +- shared-bindings/vectorio/Rectangle.c | 2 +- shared-bindings/vectorio/VectorShape.c | 2 +- shared-bindings/wiznet/wiznet5k.c | 2 +- 85 files changed, 86 insertions(+), 86 deletions(-) (limited to 'shared-bindings/microcontroller/RunMode.c') diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 4067a2a2a..75212fa91 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -65,7 +65,7 @@ //| connections and also initiate connections.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """You cannot create an instance of `_bleio.Adapter`. //| Use `_bleio.adapter` to access the sole instance available.""" //| ... diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 144b4c167..2481a9199 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -38,7 +38,7 @@ //| """Encapsulates the address of a BLE device.""" //| -//| def __init__(self, address: ReadableBuffer, address_type: int): +//| def __init__(self, address: ReadableBuffer, address_type: int) -> None: //| """Create a new Address object encapsulating the address value. //| The value itself can be one of: //| diff --git a/shared-bindings/_bleio/Attribute.c b/shared-bindings/_bleio/Attribute.c index 79f45da94..7d91c9378 100644 --- a/shared-bindings/_bleio/Attribute.c +++ b/shared-bindings/_bleio/Attribute.c @@ -36,7 +36,7 @@ //| :py:class:`~Characteristic` and :py:class:`~Descriptor`, //| but is not defined as a Python superclass of those classes.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """You cannot create an instance of :py:class:`~_bleio.Attribute`.""" //| ... //| diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index e4c81d8c2..593d8edcb 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -37,7 +37,7 @@ //| """Stores information about a BLE service characteristic and allows reading //| and writing of the characteristic's value.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """There is no regular constructor for a Characteristic. A new local Characteristic can be created //| and attached to a Service by calling `add_to_service()`. //| Remote Characteristic objects are created by `Connection.discover_remote_services()` diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index efe27e5d2..24d7a26b6 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -44,7 +44,7 @@ STATIC void raise_error_if_not_connected(bleio_characteristic_buffer_obj_t *self //| class CharacteristicBuffer: //| """Accumulates a Characteristic's incoming values in a FIFO buffer.""" //| -//| def __init__(self, characteristic: Characteristic, *, timeout: int = 1, buffer_size: int = 64): +//| def __init__(self, characteristic: Characteristic, *, timeout: int = 1, buffer_size: int = 64) -> None: //| //| """Monitor the given Characteristic. Each time a new value is written to the Characteristic //| add the newly-written bytes to a FIFO buffer. diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index ad63a3c15..5dfbc5a36 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -68,7 +68,7 @@ void bleio_connection_ensure_connected(bleio_connection_obj_t *self) { } } -//| def __init__(self): +//| def __init__(self) -> None: //| """Connections cannot be made directly. Instead, to initiate a connection use `Adapter.connect`. //| Connections may also be made when another device initiates a connection. To use a Connection //| created by a peer, read the `Adapter.connections` property. diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index 6382221a1..b709fea6d 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -39,7 +39,7 @@ //| Descriptors are attached to BLE characteristics and provide contextual //| information about the characteristic.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """There is no regular constructor for a Descriptor. A new local Descriptor can be created //| and attached to a Characteristic by calling `add_to_characteristic()`. //| Remote Descriptor objects are created by `Connection.discover_remote_services()` diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 7de79ab63..bbdde37d5 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -44,7 +44,7 @@ //| When we're the server, we ignore all connections besides the first to subscribe to //| notifications.""" //| -//| def __init__(self, characteristic: Characteristic, *, buffer_size: int): +//| def __init__(self, characteristic: Characteristic, *, buffer_size: int) -> None: //| """Monitor the given Characteristic. Each time a new value is written to the Characteristic //| add the newly-written bytes to a FIFO buffer. //| diff --git a/shared-bindings/_bleio/ScanEntry.c b/shared-bindings/_bleio/ScanEntry.c index 561472f5c..d2f0e77fd 100644 --- a/shared-bindings/_bleio/ScanEntry.c +++ b/shared-bindings/_bleio/ScanEntry.c @@ -41,7 +41,7 @@ //| it has no user-visible constructor.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`.""" //| ... //| diff --git a/shared-bindings/_bleio/ScanResults.c b/shared-bindings/_bleio/ScanResults.c index d9620e3fc..9dca90c38 100644 --- a/shared-bindings/_bleio/ScanResults.c +++ b/shared-bindings/_bleio/ScanResults.c @@ -46,7 +46,7 @@ STATIC mp_obj_t scanresults_iternext(mp_obj_t self_in) { return MP_OBJ_STOP_ITERATION; } -//| def __init__(self): +//| def __init__(self) -> None: //| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`.""" //| ... //| diff --git a/shared-bindings/_bleio/Service.c b/shared-bindings/_bleio/Service.c index d2033c60c..65f920c58 100644 --- a/shared-bindings/_bleio/Service.c +++ b/shared-bindings/_bleio/Service.c @@ -35,7 +35,7 @@ //| class Service: //| """Stores information about a BLE service and its characteristics.""" //| -//| def __init__(self, uuid: UUID, *, secondary: bool = False): +//| def __init__(self, uuid: UUID, *, secondary: bool = False) -> None: //| """Create a new Service identified by the specified UUID. It can be accessed by all //| connections. This is known as a Service server. Client Service objects are created via //| `Connection.discover_remote_services`. diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index 90a39e5e5..c6706e46a 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, ReadableBuffer, str]): +//| def __init__(self, value: Union[int, ReadableBuffer, str]) -> None: //| """Create a new UUID or UUID object encapsulating the uuid value. //| The value can be one of: //| diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index c29f7f322..32a956c93 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[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], cols: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], buttons: DigitalInOut): +//| 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) -> None: //| """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 81bbc0802..951395acb 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -47,7 +47,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t //| class PixelBuf: //| """A fast RGB[W] pixel buffer for LED and similar devices.""" //| -//| def __init__(self, size: int, *, byteorder: str = "BGR", brightness: float = 0, auto_write: bool = False, header: bytes = b"", trailer: bytes = b""): +//| def __init__(self, size: int, *, byteorder: str = "BGR", brightness: float = 0, auto_write: bool = False, header: bytes = b"", trailer: bytes = b"") -> None: //| """Create a PixelBuf object of the specified size, byteorder, and bits per pixel. //| //| When brightness is less than 1.0, a second buffer will be used to store the color values diff --git a/shared-bindings/_stage/Layer.c b/shared-bindings/_stage/Layer.c index 99a1560b5..5828669a7 100644 --- a/shared-bindings/_stage/Layer.c +++ b/shared-bindings/_stage/Layer.c @@ -33,7 +33,7 @@ //| class Layer: //| """Keep information about a single layer of graphics""" //| -//| def __init__(self, width: int, height: int, graphic: bytearray, palette: bytearray, grid: bytearray): +//| def __init__(self, width: int, height: int, graphic: bytearray, palette: bytearray, grid: bytearray) -> None: //| """Keep internal information about a layer of graphics (either a //| ``Grid`` or a ``Sprite``) in a format suitable for fast rendering //| with the ``render()`` function. diff --git a/shared-bindings/_stage/Text.c b/shared-bindings/_stage/Text.c index 4468de771..555eb5831 100644 --- a/shared-bindings/_stage/Text.c +++ b/shared-bindings/_stage/Text.c @@ -33,7 +33,7 @@ //| class Text: //| """Keep information about a single grid of text""" //| -//| def __init__(self, width: int, height: int, font: bytearray, palette: bytearray, chars: bytearray): +//| def __init__(self, width: int, height: int, font: bytearray, palette: bytearray, chars: bytearray) -> None: //| """Keep internal information about a grid of text //| in a format suitable for fast rendering //| with the ``render()`` function. diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index e52d9b16b..a91ffd946 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -48,7 +48,7 @@ //| val = adc.value""" //| -//| def __init__(self, pin: microcontroller.Pin): +//| def __init__(self, pin: microcontroller.Pin) -> None: //| """Use the AnalogIn on the given pin. The reference voltage varies by //| platform so use ``reference_voltage`` to read the configured setting. //| diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 9523b91a9..3b8d9354a 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -47,7 +47,7 @@ //| dac = analogio.AnalogOut(pin.PA02) # output on pin PA02 //| dac.value = 32768 # makes PA02 1.65V""" //| -//| def __init__(self, pin: microcontroller.Pin): +//| def __init__(self, pin: microcontroller.Pin) -> None: //| """Use the AnalogOut on the given pin. //| //| :param ~microcontroller.Pin pin: the pin to output to""" diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index bf08d14ce..304c737f6 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -38,7 +38,7 @@ //| class I2SOut: //| """Output an I2S audio signal""" //| -//| def __init__(self, bit_clock: microcontroller.Pin, word_select: microcontroller.Pin, data: microcontroller.Pin, *, left_justified: bool): +//| def __init__(self, bit_clock: microcontroller.Pin, word_select: microcontroller.Pin, data: microcontroller.Pin, *, left_justified: bool) -> None: //| """Create a I2SOut object associated with the given pins. //| //| :param ~microcontroller.Pin bit_clock: The bit clock (or serial clock) pin diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 329c7bde5..9a963bcfa 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -39,7 +39,7 @@ //| class PDMIn: //| """Record an input PDM audio stream""" //| -//| def __init__(self, clock_pin: microcontroller.Pin, data_pin: microcontroller.Pin, *, sample_rate: int = 16000, bit_depth: int = 8, mono: bool = True, oversample: int = 64, startup_delay: float = 0.11): +//| def __init__(self, clock_pin: microcontroller.Pin, data_pin: microcontroller.Pin, *, sample_rate: int = 16000, bit_depth: int = 8, mono: bool = True, oversample: int = 64, startup_delay: float = 0.11) -> None: //| """Create a PDMIn object associated with the given pins. This allows you to //| record audio signals from the given pins. Individual ports may put further //| restrictions on the recording parameters. The overall sample rate is diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index dc5cfd820..20ebae001 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -38,7 +38,7 @@ //| class RawSample: //| """A raw audio sample buffer in memory""" //| -//| def __init__(self, buffer: array.array, *, channel_count: int = 1, sample_rate: int = 8000): +//| def __init__(self, buffer: array.array, *, channel_count: int = 1, sample_rate: int = 8000) -> None: //| """Create a RawSample based on the given buffer of signed values. If channel_count is more than //| 1 then each channel's samples should alternate. In other words, for a two channel buffer, the //| first sample will be for channel 1, the second sample will be for channel two, the third for diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index b31a110c6..d986d6db5 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -40,7 +40,7 @@ //| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating //| an internal buffer.""" //| -//| def __init__(self, file: typing.BinaryIO, buffer: ReadableBuffer): +//| def __init__(self, file: typing.BinaryIO, buffer: ReadableBuffer) -> None: //| """Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| //| :param typing.BinaryIO file: Already opened wave file diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index a500eb7c7..e1a78c44c 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -39,7 +39,7 @@ //| class AudioOut: //| """Output an analog audio signal""" //| -//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000): +//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000) -> None: //| """Create a AudioOut object associated with the given pin(s). This allows you to //| play audio signals out on the given pin(s). //| diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index a31953e03..0d7712b03 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -41,7 +41,7 @@ //| class Mixer: //| """Mixes one or more audio samples together into one sample.""" //| -//| def __init__(self, voice_count: int = 2, buffer_size: int = 1024, channel_count: int = 2, bits_per_sample: int = 16, samples_signed: bool = True, sample_rate: int = 8000): +//| def __init__(self, voice_count: int = 2, buffer_size: int = 1024, channel_count: int = 2, bits_per_sample: int = 16, samples_signed: bool = True, sample_rate: int = 8000) -> None: //| """Create a Mixer object that can mix multiple channels with the same sample rate. //| Samples are accessed and controlled with the mixer's `audiomixer.MixerVoice` objects. //| diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index f94d8f176..26a044d46 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -42,7 +42,7 @@ //| //| Used to access and control samples with `audiomixer.Mixer`.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """MixerVoice instance object(s) created by `audiomixer.Mixer`.""" //| ... //| diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 46e6c81f0..b7bb44957 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -37,7 +37,7 @@ //| class MP3: //| """Load a mp3 file for audio playback""" //| -//| def __init__(self, file: typing.BinaryIO, buffer: WriteableBuffer): +//| def __init__(self, file: typing.BinaryIO, buffer: WriteableBuffer) -> None: //| //| """Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index b16538f17..1d740823a 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -39,7 +39,7 @@ //| class PWMAudioOut: //| """Output an analog audio signal by varying the PWM duty cycle.""" //| -//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000): +//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000) -> None: //| """Create a PWMAudioOut object associated with the given pin(s). This allows you to //| play audio signals out on the given pin(s). In contrast to mod:`audioio`, //| the pin(s) specified are digital pins, and are driven with a device-dependent PWM diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 710275b2f..a9ab475bd 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -40,7 +40,7 @@ //| class I2C: //| """Two wire serial protocol""" //| -//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int): +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int) -> None: //| """I2C is a two-wire protocol for communicating between devices. At the //| physical level it consists of 2 wires: SCL and SDA, the clock and data //| lines respectively. diff --git a/shared-bindings/bitbangio/OneWire.c b/shared-bindings/bitbangio/OneWire.c index b9fce5e05..da94a393e 100644 --- a/shared-bindings/bitbangio/OneWire.c +++ b/shared-bindings/bitbangio/OneWire.c @@ -42,7 +42,7 @@ //| //| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126""" //| -//| def __init__(self, pin: microcontroller.Pin): +//| def __init__(self, pin: microcontroller.Pin) -> None: //| //| """Create a OneWire object associated with the given pin. The object //| implements the lowest level timing-sensitive bits of the protocol. diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 90483e3eb..0a4d62361 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -51,7 +51,7 @@ //| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines //| and therefore the hardware.)""" //| -//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): +//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None) -> None: //| """Construct an SPI object on the given pins. //| //| .. seealso:: Using this class directly requires careful lock management. diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index cf38fdce6..d34386a68 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -39,7 +39,7 @@ //| class I2C: //| """Two wire serial protocol""" //| -//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255): +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255) -> None: //| //| """I2C is a two-wire protocol for communicating between devices. At the //| physical level it consists of 2 wires: SCL and SDA, the clock and data diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index 66f0fba3d..1fae39181 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -37,7 +37,7 @@ //| class OneWire: //| """Lowest-level of the Maxim OneWire protocol""" //| -//| def __init__(self, pin: microcontroller.Pin): +//| def __init__(self, pin: microcontroller.Pin) -> None: //| """(formerly Dallas Semi) OneWire protocol. //| //| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126 diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index a40c41e6a..173f8aa6d 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -53,7 +53,7 @@ //| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines //| and therefore the hardware.)""" //| -//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): +//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None) -> None: //| //| """Construct an SPI object on the given pins. //| diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index f4f8746fe..31a36a809 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -44,7 +44,7 @@ //| class UART: //| """A bidirectional serial protocol""" -//| def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Parity = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64): +//| def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Parity = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64) -> None: //| """A common bidirectional serial protocol that uses an an agreed upon speed //| rather than a shared clock line. //| diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index 64e8701b7..e40ec3b64 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -13,7 +13,7 @@ //| """Counter will keep track of the number of falling edge transistions (pulses) on a //| given pin""" //| -//| def __init__(self, pin_a: microcontroller.Pin): +//| def __init__(self, pin_a: microcontroller.Pin) -> None: //| """Create a Counter object associated with the given pin. It tracks the number of //| falling pulses relative when the object is constructed. //| diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 21dc4dfed..ffc65620e 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -50,7 +50,7 @@ //| a pin, see the :py:class:`analogio.AnalogIn` and //| :py:class:`analogio.AnalogOut` classes.""" //| -//| def __init__(self, pin: microcontroller.Pin): +//| def __init__(self, pin: microcontroller.Pin) -> None: //| """Create a new DigitalInOut object associated with the pin. Defaults to input //| with no pull. Use :py:meth:`switch_to_input` and //| :py:meth:`switch_to_output` to change the direction. diff --git a/shared-bindings/digitalio/Direction.c b/shared-bindings/digitalio/Direction.c index 56e2a281c..3798b3fa7 100644 --- a/shared-bindings/digitalio/Direction.c +++ b/shared-bindings/digitalio/Direction.c @@ -41,7 +41,7 @@ //| class Direction: //| """Defines the direction of a digital pin""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Enum-like class to define which direction the digital values are //| going.""" //| ... diff --git a/shared-bindings/digitalio/DriveMode.c b/shared-bindings/digitalio/DriveMode.c index d1d962d34..208143a2f 100644 --- a/shared-bindings/digitalio/DriveMode.c +++ b/shared-bindings/digitalio/DriveMode.c @@ -29,7 +29,7 @@ //| class DriveMode: //| """Defines the drive mode of a digital pin""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Enum-like class to define the drive mode used when outputting //| digital values.""" //| ... diff --git a/shared-bindings/digitalio/Pull.c b/shared-bindings/digitalio/Pull.c index 46d12bf88..9656811c8 100644 --- a/shared-bindings/digitalio/Pull.c +++ b/shared-bindings/digitalio/Pull.c @@ -29,7 +29,7 @@ //| class Pull: //| """Defines the pull of a digital input pin""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Enum-like class to define the pull value, if any, used while reading //| digital values in.""" //| ... diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 9677b51f6..b2cda2153 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -39,7 +39,7 @@ //| class Bitmap: //| """Stores values of a certain size in a 2D array""" //| -//| def __init__(self, width: int, height: int, value_count: int): +//| def __init__(self, width: int, height: int, value_count: int) -> None: //| """Create a Bitmap object with the given fixed size. Each pixel stores a value that is used to //| index into a corresponding palette. This enables differently colored sprites to share the //| underlying Bitmap. value_count is used to minimize the memory used to store the Bitmap. diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index 6126c4194..17eed1a9b 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -39,7 +39,7 @@ //| class ColorConverter: //| """Converts one color format to another.""" //| -//| def __init__(self, *, dither: bool = False): +//| def __init__(self, *, dither: bool = False) -> None: //| """Create a ColorConverter object to convert color formats. Only supports RGB888 to RGB565 //| currently. //| :param bool dither: Adds random noise to dither the output image""" diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index e2e648876..8d5fa8718 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: 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): +//| 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) -> None: //| 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 diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index b9f7dd9a1..21eaf14da 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: 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): +//| 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) -> None: //| """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/FourWire.c b/shared-bindings/displayio/FourWire.c index 7e5324924..83d260c0f 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -42,7 +42,7 @@ //| """Manage updating a display over SPI four wire protocol in the background while Python code runs. //| It doesn't handle display initialization.""" //| -//| def __init__(self, spi_bus: busio.SPI, *, command: microcontroller.Pin, chip_select: microcontroller.Pin, reset: microcontroller.Pin = None, baudrate: int = 24000000, polarity: int = 0, phase: int = 0): +//| def __init__(self, spi_bus: busio.SPI, *, command: microcontroller.Pin, chip_select: microcontroller.Pin, reset: microcontroller.Pin = None, baudrate: int = 24000000, polarity: int = 0, phase: int = 0) -> None: //| """Create a FourWire object associated with the given pins. //| //| The SPI bus and pins are then in use by the display until `displayio.release_displays()` is diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 9d12ca161..02915da64 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -38,7 +38,7 @@ //| class Group: //| """Manage a group of sprites and groups and how they are inter-related.""" //| -//| def __init__(self, *, max_size: int = 4, scale: int = 1, x: int = 0, y: int = 0): +//| def __init__(self, *, max_size: int = 4, scale: int = 1, x: int = 0, y: int = 0) -> None: //| """Create a Group of a given size and scale. Scale is in one dimension. For example, scale=2 //| leads to a layer's pixel being 2x2 pixels when in the group. //| diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index 7c1827db3..c8b6702a1 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -42,7 +42,7 @@ //| """Manage updating a display over I2C in the background while Python code runs. //| It doesn't handle display initialization.""" //| -//| def __init__(self, i2c_bus: busio.I2C, *, device_address: int, reset: microcontroller.Pin = None): +//| def __init__(self, i2c_bus: busio.I2C, *, device_address: int, reset: microcontroller.Pin = None) -> None: //| """Create a I2CDisplay object associated with the given I2C bus and reset pin. //| //| The I2C bus and pins are then in use by the display until `displayio.release_displays()` is diff --git a/shared-bindings/displayio/OnDiskBitmap.c b/shared-bindings/displayio/OnDiskBitmap.c index 0c6ca761c..7e94a0401 100644 --- a/shared-bindings/displayio/OnDiskBitmap.c +++ b/shared-bindings/displayio/OnDiskBitmap.c @@ -69,7 +69,7 @@ //| while True: //| pass""" //| -//| def __init__(self, file: file): +//| def __init__(self, file: file) -> None: //| """Create an OnDiskBitmap object with the given file. //| //| :param file file: The open bitmap file""" diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index a06dd38ff..5418133e1 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -46,7 +46,7 @@ //| """Map a pixel palette_index to a full color. Colors are transformed to the display's format internally to //| save memory.""" //| -//| def __init__(self, color_count: int): +//| def __init__(self, color_count: int) -> None: //| """Create a Palette object to store a set number of colors. //| //| :param int color_count: The number of colors in the Palette""" diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c index 247ac5dd5..30c9d373c 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/displayio/ParallelBus.c @@ -42,7 +42,7 @@ //| protocol may be refered to as 8080-I Series Parallel Interface in datasheets. It doesn't handle //| display initialization.""" //| -//| def __init__(self, *, data0: microcontroller.Pin, command: microcontroller.Pin, chip_select: microcontroller.Pin, write: microcontroller.Pin, read: microcontroller.Pin, reset: microcontroller.Pin): +//| def __init__(self, *, data0: microcontroller.Pin, command: microcontroller.Pin, chip_select: microcontroller.Pin, write: microcontroller.Pin, read: microcontroller.Pin, reset: microcontroller.Pin) -> None: //| """Create a ParallelBus object associated with the given pins. The bus is inferred from data0 //| by implying the next 7 additional pins on a given GPIO port. //| diff --git a/shared-bindings/displayio/Shape.c b/shared-bindings/displayio/Shape.c index 258ac4902..4d737ecae 100644 --- a/shared-bindings/displayio/Shape.c +++ b/shared-bindings/displayio/Shape.c @@ -37,7 +37,7 @@ //| class Shape: //| """Represents a shape made by defining boundaries that may be mirrored.""" //| -//| def __init__(self, width: int, height: int, *, mirror_x: bool = False, mirror_y: bool = False): +//| def __init__(self, width: int, height: int, *, mirror_x: bool = False, mirror_y: bool = False) -> None: //| """Create a Shape object with the given fixed size. Each pixel is one bit and is stored by the //| column boundaries of the shape on each row. Each row's boundary defaults to the full row. //| diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index d3ad0f0fc..348fcb448 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -48,7 +48,7 @@ //| //| A single tile grid is also known as a Sprite.""" //| -//| def __init__(self, bitmap: displayio.Bitmap, *, pixel_shader: displayio.Palette, width: int = 1, height: int = 1, tile_width: int = None, tile_height: int = None, default_tile: int = 0, x: int = 0, y: int = 0): +//| def __init__(self, bitmap: displayio.Bitmap, *, pixel_shader: displayio.Palette, width: int = 1, height: int = 1, tile_width: int = None, tile_height: int = None, default_tile: int = 0, x: int = 0, y: int = 0) -> None: //| """Create a TileGrid object. The bitmap is source for 2d pixels. The pixel_shader is used to //| convert the value and its location to a display native pixel color. This may be a simple color //| palette lookup, a gradient, a pattern or a color transformer. diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index 6d6a39818..9e2f81c47 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -39,7 +39,7 @@ //| class BuiltinFont: //| """A font built into CircuitPython""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Creation not supported. Available fonts are defined when CircuitPython is built. See the //| `Adafruit_CircuitPython_Bitmap_Font `_ //| library for dynamically loaded fonts.""" diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 29e11638a..737e0696f 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -47,7 +47,7 @@ //| 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: framebuffer, *, rotation: int = 0, auto_refresh: bool = True): +//| def __init__(self, framebuffer: framebuffer, *, rotation: int = 0, auto_refresh: bool = True) -> None: //| """Create a Display object with the given framebuffer (a buffer, array, ulab.array, etc) //| //| :param framebuffer: The framebuffer that the display is connected to diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index 1aed71f25..5f99b166c 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -46,7 +46,7 @@ //| //| FrequencyIn will not determine pulse width (use ``PulseIn``).""" //| -//| def __init__(self, pin: microcontroller.Pin, capture_period: int = 10): +//| def __init__(self, pin: microcontroller.Pin, capture_period: int = 10) -> None: //| """Create a FrequencyIn object associated with the given pin. //| //| :param ~microcontroller.Pin pin: Pin to read frequency from. diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c index 8c0f58d0e..f03a6cd33 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: DigitalInOut, b2: DigitalInOut, b3: DigitalInOut, b4: DigitalInOut, b5: DigitalInOut, b6: DigitalInOut, b7: DigitalInOut, b8: DigitalInOut): +//| def __init__(self, b1: DigitalInOut, b2: DigitalInOut, b3: DigitalInOut, b4: DigitalInOut, b5: DigitalInOut, b6: DigitalInOut, b7: DigitalInOut, b8: DigitalInOut) -> None: //| """Initializes button scanning routines. //| //| The ``b1``-``b8`` parameters are ``DigitalInOut`` objects, which diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c index f01c95704..e05a95865 100644 --- a/shared-bindings/gamepadshift/GamePadShift.c +++ b/shared-bindings/gamepadshift/GamePadShift.c @@ -36,7 +36,7 @@ //| class GamePadShift: //| """Scan buttons for presses through a shift register""" //| -//| def __init__(self, clock: DigitalInOut, data: DigitalInOut, latch: DigitalInOut): +//| def __init__(self, clock: DigitalInOut, data: DigitalInOut, latch: DigitalInOut) -> None: //| """Initializes button scanning routines. //| //| The ``clock``, ``data`` and ``latch`` parameters are ``DigitalInOut`` diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index 86bf3ca42..0ecc1ac6a 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -53,7 +53,7 @@ //| print("Longitude: {0:.6f} degrees".format(nav.longitude))""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Turn on the GNSS. //| //| :param gnss.SatelliteSystem system: satellite system to use""" diff --git a/shared-bindings/gnss/PositionFix.c b/shared-bindings/gnss/PositionFix.c index 9d4c96fe0..f2cd2b9fe 100644 --- a/shared-bindings/gnss/PositionFix.c +++ b/shared-bindings/gnss/PositionFix.c @@ -29,7 +29,7 @@ //| class PositionFix: //| """Position fix mode""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Enum-like class to define the position fix mode.""" //| //| INVALID: PositionFix = ... diff --git a/shared-bindings/gnss/SatelliteSystem.c b/shared-bindings/gnss/SatelliteSystem.c index 3405021d4..2fd785f0a 100644 --- a/shared-bindings/gnss/SatelliteSystem.c +++ b/shared-bindings/gnss/SatelliteSystem.c @@ -29,7 +29,7 @@ //| class SatelliteSystem: //| """Satellite system type""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Enum-like class to define the satellite system type.""" //| //| GPS: SatelliteSystem = ... diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2cperipheral/I2CPeripheral.c index 0a1c798ab..b528ca9c3 100644 --- a/shared-bindings/i2cperipheral/I2CPeripheral.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -52,7 +52,7 @@ STATIC mp_obj_t mp_obj_new_i2cperipheral_i2c_peripheral_request(i2cperipheral_i2 //| class I2CPeripheral: //| """Two wire serial protocol peripheral""" //| -//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: tuple, smbus: bool = False): +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: tuple, smbus: bool = False) -> None: //| """I2C is a two-wire protocol for communicating between devices. //| This implements the peripheral (sensor, secondary) side. //| @@ -227,7 +227,7 @@ const mp_obj_type_t i2cperipheral_i2c_peripheral_type = { //| class I2CPeripheralRequest: //| -//| def __init__(self, peripheral: i2cperipheral.I2CPeripheral, address: int, is_read: bool, is_restart: bool): +//| def __init__(self, peripheral: i2cperipheral.I2CPeripheral, address: int, is_read: bool, is_restart: bool) -> None: //| """Information about an I2C transfer request //| This cannot be instantiated directly, but is returned by :py:meth:`I2CPeripheral.request`. //| diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index f53949d85..931c0b4c4 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -36,7 +36,7 @@ //| class Pin: //| """Identifies an IO pin on the microcontroller.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Identifies an IO pin on the microcontroller. They are fixed by the //| hardware so they cannot be constructed on demand. Instead, use //| `board` or `microcontroller.pin` to reference the desired pin.""" diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index 32ec4f2e7..d9f780f84 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -44,7 +44,7 @@ //| print(microcontroller.cpu.temperature)""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """You cannot create an instance of `microcontroller.Processor`. //| Use `microcontroller.cpu` to access the sole instance available.""" //| ... diff --git a/shared-bindings/microcontroller/RunMode.c b/shared-bindings/microcontroller/RunMode.c index f133c34b1..38bbb612b 100644 --- a/shared-bindings/microcontroller/RunMode.c +++ b/shared-bindings/microcontroller/RunMode.c @@ -29,7 +29,7 @@ //| class RunMode: //| """run state of the microcontroller""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Enum-like class to define the run mode of the microcontroller and //| CircuitPython.""" //| diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 6f282d697..278ac4d73 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -44,7 +44,7 @@ //| microcontroller.nvm[0:3] = b\"\xcc\x10\x00\"""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Not currently dynamically supported. Access the sole instance through `microcontroller.nvm`.""" //| ... //| diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index a7f1d9da5..15731ea40 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -45,7 +45,7 @@ //| level converters must be used to connect the I/O lines to pins //| of 3.3V boards.""" //| -//| def __init__(self, data_pin: microcontroller.Pin, clock_pin: microcontroller.Pin): +//| def __init__(self, data_pin: microcontroller.Pin, clock_pin: microcontroller.Pin) -> None: //| """Create a Ps2 object associated with the given pins. //| //| :param ~microcontroller.Pin data_pin: Pin tied to data wire. diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c index 862a500bf..e3aa43a31 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pulseio/PWMOut.c @@ -38,7 +38,7 @@ //| class PWMOut: //| """Output a Pulse Width Modulated signal on a given pin.""" //| -//| def __init__(self, pin: microcontroller.Pin, *, duty_cycle: int = 0, frequency: int = 500, variable_frequency: bool = False): +//| def __init__(self, pin: microcontroller.Pin, *, duty_cycle: int = 0, frequency: int = 500, variable_frequency: bool = False) -> None: //| """Create a PWM object associated with the given pin. This allows you to //| write PWM signals out on the given pin. Frequency is fixed after init //| unless ``variable_frequency`` is True. diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index 75ea1a80e..4bcff06ee 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -40,7 +40,7 @@ //| and low cost temperature sensors (DHT). The pulsed signal consists of timed active and //| idle periods. Unlike PWM, there is no set duration for active and idle pairs.""" //| -//| def __init__(self, pin: microcontroller.Pin, maxlen: int = 2, *, idle_state: bool = False): +//| def __init__(self, pin: microcontroller.Pin, maxlen: int = 2, *, idle_state: bool = False) -> None: //| """Create a PulseIn object associated with the given pin. The object acts as //| a read-only sequence of pulse lengths with a given max length. When it is //| active, new pulse lengths are added to the end of the list. When there is diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index dfed6d304..9e2d68744 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -41,7 +41,7 @@ //| pulsed signal consists of timed on and off periods. Unlike PWM, there is no set duration //| for on and off pairs.""" //| -//| def __init__(self, carrier: pulseio.PWMOut): +//| def __init__(self, carrier: pulseio.PWMOut) -> None: //| """Create a PulseOut object associated with the given PWMout object. //| //| :param ~pulseio.PWMOut carrier: PWMOut that is set to output on the desired pin. diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 0099d9f0c..e04336351 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: Optional[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) -> None: //| """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 diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index 201336266..37c4ee324 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -37,7 +37,7 @@ //| class IncrementalEncoder: //| """IncrementalEncoder determines the relative rotational position based on two series of pulses.""" //| -//| def __init__(self, pin_a: microcontroller.Pin, pin_b: microcontroller.Pin): +//| def __init__(self, pin_a: microcontroller.Pin, pin_b: microcontroller.Pin) -> None: //| """Create an IncrementalEncoder object associated with the given pins. It tracks the positional //| state of an incremental rotary encoder (also known as a quadrature encoder.) Position is //| relative to the position when the object is contructed. diff --git a/shared-bindings/rtc/RTC.c b/shared-bindings/rtc/RTC.c index 009256176..f6d1e06c4 100644 --- a/shared-bindings/rtc/RTC.c +++ b/shared-bindings/rtc/RTC.c @@ -41,7 +41,7 @@ const rtc_rtc_obj_t rtc_rtc_obj = {{&rtc_rtc_type}}; //| class RTC: //| """Real Time Clock""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """This class represents the onboard Real Time Clock. It is a singleton and will always return the same instance.""" //| ... //| diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c index 6b32bb1c1..7f53f741d 100644 --- a/shared-bindings/sdcardio/SDCard.c +++ b/shared-bindings/sdcardio/SDCard.c @@ -44,7 +44,7 @@ //| `busio.SPI`, not `bitbangio.SPI`. Usually an SDCard object is used //| with ``storage.VfsFat`` to allow file I/O to an SD card.""" //| -//| def __init__(bus:busio.SPI, cs: digitalio.DigitalInOut=digitalio.DigitalInOut, baudrate: int=8000000): +//| def __init__(bus:busio.SPI, cs: digitalio.DigitalInOut=digitalio.DigitalInOut, baudrate: int=8000000) -> None: //| """Construct an SPI SD Card object with the given properties //| //| :param busio.SPI spi: The SPI bus diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index 8890c1f3c..94ba1c387 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -49,7 +49,7 @@ //| 25MHz. Usually an SDCard object is used with ``storage.VfsFat`` //| to allow file I/O to an SD card.""" //| -//| def __init__(*, clock: digitalio.DigitalInOut, command: digitalio.DigitalInOut, data: List[digitalio.DigitalInOut], frequency: int): +//| def __init__(*, clock: digitalio.DigitalInOut, command: digitalio.DigitalInOut, data: List[digitalio.DigitalInOut], frequency: int) -> None: //| """Construct an SDIO SD Card object with the given properties //| //| :param ~microcontroller.Pin clock: the pin to use for the clock. diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 10a56ef40..985104d55 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -46,7 +46,7 @@ STATIC const mp_obj_type_t socket_type; //| class socket: //| -//| def __init__(self, family: int, type: int, proto: int): +//| def __init__(self, family: int, type: int, proto: int) -> None: //| """Create a new socket //| //| :param ~int family: AF_INET or AF_INET6 diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 3abc5512c..0a34ef74e 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -168,7 +168,7 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_erase_filesystem), MP_ROM_PTR(&storage_erase_filesystem_obj) }, //| class VfsFat: -//| def __init__(self, block_device: Any): +//| def __init__(self, block_device: Any) -> None: //| """Create a new VfsFat filesystem around the given block device. //| //| :param block_device: Block device the the filesystem lives on""" diff --git a/shared-bindings/terminalio/Terminal.c b/shared-bindings/terminalio/Terminal.c index 43310dd2a..623b99e09 100644 --- a/shared-bindings/terminalio/Terminal.c +++ b/shared-bindings/terminalio/Terminal.c @@ -40,7 +40,7 @@ //| class Terminal: //| """Display a character stream with a TileGrid""" //| -//| def __init__(self, tilegrid: bitmap, font: fontio.BuiltinFont): +//| def __init__(self, tilegrid: bitmap, font: fontio.BuiltinFont) -> None: //| """Terminal manages tile indices and cursor position based on VT100 commands. The font should be //| a `fontio.BuiltinFont` and the TileGrid's bitmap should match the font's bitmap.""" //| ... diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 531980eff..9b68bdd8d 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -93,7 +93,7 @@ mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, const mp } //| class struct_time: -//| def __init__(self, time_tuple: Any): +//| def __init__(self, time_tuple: Any) -> None: //| """Structure used to capture a date and time. Note that it takes a tuple! //| //| :param tuple time_tuple: Tuple of time info: ``(tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday, tm_yday, tm_isdst)`` diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index 50ca952ce..d63db4ba1 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -52,7 +52,7 @@ //| print("touched!")""" //| -//| def __init__(self, pin: microcontroller.Pin): +//| def __init__(self, pin: microcontroller.Pin) -> None: //| """Use the TouchIn on the given pin. //| //| :param ~microcontroller.Pin pin: the pin to read from""" diff --git a/shared-bindings/ulab/__init__.pyi b/shared-bindings/ulab/__init__.pyi index e5de1391b..03bfe3610 100644 --- a/shared-bindings/ulab/__init__.pyi +++ b/shared-bindings/ulab/__init__.pyi @@ -17,7 +17,7 @@ https://docs.scipy.org/doc/numpy/index.html""" class array: """1- and 2- dimensional array""" - def __init__(self, values, *, dtype=float): + def __init__(self, values, *, dtype=float) -> None: """:param sequence values: Sequence giving the initial content of the array. :param dtype: The type of array values, ``int8``, ``uint8``, ``int16``, ``uint16``, or ``float`` diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c index 62c4f98e8..5b26a94c4 100644 --- a/shared-bindings/usb_midi/PortIn.c +++ b/shared-bindings/usb_midi/PortIn.c @@ -38,7 +38,7 @@ //| class PortIn: //| """Receives midi commands over USB""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """You cannot create an instance of `usb_midi.PortIn`. //| //| PortIn objects are constructed for every corresponding entry in the USB diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c index 65923fd96..7b010591d 100644 --- a/shared-bindings/vectorio/Circle.c +++ b/shared-bindings/vectorio/Circle.c @@ -11,7 +11,7 @@ //| class Circle: //| -//| def __init__(self, radius: int): +//| def __init__(self, radius: int) -> None: //| """Circle is positioned on screen by its center point. //| //| :param radius: The radius of the circle in pixels""" diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index 3443d9e42..486619eae 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -18,7 +18,7 @@ //| from typing import List, Tuple //| //| class Polygon: -//| def __init__(self, points: List[ Tuple[ x, y ], ... ] ): +//| def __init__(self, points: List[ Tuple[ x, y ], ... ] ) -> None: //| """Represents a closed shape by ordered vertices //| //| :param points: Vertices for the polygon""" diff --git a/shared-bindings/vectorio/Rectangle.c b/shared-bindings/vectorio/Rectangle.c index f04a25c35..9a637f317 100644 --- a/shared-bindings/vectorio/Rectangle.c +++ b/shared-bindings/vectorio/Rectangle.c @@ -8,7 +8,7 @@ #include "supervisor/shared/translate.h" //| class Rectangle: -//| def __init__(self, width: int, height: int): +//| def __init__(self, width: int, height: int) -> None: //| """Represents a rectangle by defining its bounds //| //| :param width: The number of pixels wide diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index c512bcd54..d1042b1c6 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -20,7 +20,7 @@ //| class VectorShape: -//| def __init__(self, shape: vectorio.Polygon, pixel_shader: displayio.Palette, x: int=0, y: int=0): +//| def __init__(self, shape: vectorio.Polygon, pixel_shader: displayio.Palette, x: int=0, y: int=0) -> None: //| """Binds a vector shape to a location and pixel color //| //| :param shape: The shape to draw. diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index 90bd9ac2c..a58ac5b50 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -49,7 +49,7 @@ //| class WIZNET5K: //| """Wrapper for Wiznet 5500 Ethernet interface""" //| -//| def __init__(self, spi: busio.SPI, cs: microcontroller.Pin, rst: microcontroller.Pin, dhcp: bool = True): +//| def __init__(self, spi: busio.SPI, cs: microcontroller.Pin, rst: microcontroller.Pin, dhcp: bool = True) -> None: //| """Create a new WIZNET5500 interface using the specified pins //| //| :param ~busio.SPI spi: spi bus to use -- cgit v1.2.3