python-editor-v3
python-editor-v3 copied to clipboard
Autocompletion shows more module dunder attributes than available in MicroPython
trafficstars
Bug Description
With a my_module.py file that only contains FOO = 0.
In the Editor:

In MicroPython:
MicroPython 569e361 on 2022-06-20; micro:bit v2.0.0 with nRF52833
Type "help()" for more information.
>>> import my_module
>>> dir(my_module)
['__class__', '__name__', 'FOO']
>>>
I believe some of the dunder features in MicroPython can be enabled/disabled via compile time flags, these are the ones we've got at the minute in V2.
Technically I don't think __class__ is correct, so I've opened this issue in the MicroPython repo, in V1 only __name__ is available:
- https://github.com/microbit-foundation/micropython-microbit-v2/issues/104
How To Reproduce
In bug description
Expected behavior
Only show dunder attributes/functions available in MicroPython.
Screenshots
In description.
Environment
N/A
Additional context
N/A