← index #4923Issue #4427
Related · high · value 7.975
QUERY · ISSUE

BUG: sys.modules['sys'] not pointing __import__('sys')

openby pmp-popened 2019-07-16updated 2019-07-16

Probably the same reason as :
https://github.com/micropython/micropython/issues/4427

CANDIDATE · ISSUE

BUG: sys.modules['__main__'] not pointing __import__('__main__')

openby pmp-popened 2019-01-25updated 2025-03-03
proposed-closeneeds-info

cpython automatically gives access to sys.modules[__name__] from module '__main__' and returns value of __import__('__main__').

micropython does not and forces to use__import__(__name__) which is not a good way to get a module by fully qualified name ( eg when getting a dot package name you only get toplevel ).

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied