python-editor-v3 icon indicating copy to clipboard operation
python-editor-v3 copied to clipboard

Autocompletion shows more module dunder attributes than available in MicroPython

Open microbit-carlos opened this issue 3 years ago • 0 comments
trafficstars

Bug Description

With a my_module.py file that only contains FOO = 0.

In the Editor: image

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

microbit-carlos avatar Jul 06 '22 10:07 microbit-carlos