Josverl / micropython-stubs

Stubs of most MicroPython ports, boards and versions to make writing code that much simpler.
https://micropython-stubs.readthedocs.io
MIT License
133 stars 21 forks source link

class __init__ for machine.UART is unspecific #725

Open Josverl opened 8 months ago

Josverl commented 8 months ago

the documentation has an unclear specification for some of the init methods

the params for the init method should be def __init__ ( self, id , <same params as init>) -> None: ...

machine.Timer

class Timer:
    def __init__(self, id, *args, **kwargs) -> None: ...
    def init(self, *, freq, prescaler, period, mode=UP, div=1, callback=None, deadtime=0) -> None:

machine.SPI

class SPI:
    def __init__(self, id, *args, **kwargs) -> None: ...
    def init(
        self, baudrate=1000000, *, polarity=0, phase=0, bits=8, firstbit=MSB, sck=None, mosi=None, miso=None, pins: Optional[Tuple]
    ) -> None:
class UART:
    def init(self, baudrate=9600, bits=8, parity=None, stop=1, *args, **kwargs) -> None: 
    def __init__(self, id, *args, **kwargs) -> None: ...
Josverl commented 8 months ago

ref: https://github.com/paulober/Pico-W-Stub/issues/7