-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Open
Description
Tested under Unix and RP2.
To replicate create a directory (e.g. ~/test) containing foo.py
:
def bar():
print('bar')
Import behaves as expected. CPython behaves identically.:
MicroPython v1.14 on 2021-03-28; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> import foo
>>> dir(foo)
['__class__', '__name__', '__file__', 'bar']
>>>
Create a subdirectory foo
and repeat:
MicroPython v1.14 on 2021-03-28; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> import foo
>>> dir(foo)
['__class__', '__name__', '__path__']
CPython correctly imports the module:
[adminpete@capybara]: ~/test
$ python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import foo
>>> dir(foo)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'bar']
>>>
Metadata
Metadata
Assignees
Labels
No labels