microbit-foundation / micropython-microbit-stubs

Type stubs for MicroPython for micro:bit to support the micro:bit Python Editor V3
https://python.microbit.org/
Other
3 stars 2 forks source link

Fix modelling of microbit module's audio, compass etc? #6

Open microbit-matt-hillsdon opened 2 years ago

microbit-matt-hillsdon commented 2 years ago

This in microbit/__init__.pyi needs reconsidering:

from . import accelerometer as accelerometer
from . import compass as compass
from . import display as display
from . import i2c as i2c
from . import microphone as microphone
from . import speaker as speaker
from . import spi as spi
from . import uart as uart

None of these are modules at runtime in MicroPython, though they were documented using the directives for modules in the docs. They are actually e.g. MicroBitCompass objects.

audio is actually a module, but for unclear reasons cannot be imported as microbit.audio (via import or from microbit.audio import ...).

microbit-matt-hillsdon commented 1 year ago

If we do this we need to carefully consider the impact on the V3 Editor UI. I think it's unlikely we'll make this change without a significant rethink of how we present this information there.