Skip to content

Autocompletion shows more module dunder attributes than available in MicroPython #803

Open
@microbit-carlos

Description

@microbit-carlos

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:

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions