Message317050
Re-opening because I've found a simple example that does not involve __main__.
./func/__init__.py:func = 1
./func/__init__.py:from . import func
./func/__init__.py:print(f"Namespace value of func after func module import:{func}")
./func/func.py:print("Module imported")
./main.py:import func
./main.py:def func(x):
./main.py: return x
If you create files that look like that, and then run: "python3.6 main.py" I get this output:
Namespace value of func after func module import:1
If I comment out the "func = 1" line, then func ends up being imported (and printing as a <module...>). |
|
Date |
User |
Action |
Args |
2018-05-18 19:30:32 | Rolf Campbell | set | recipients:
+ Rolf Campbell, brett.cannon, ncoghlan, r.david.murray, eric.snow |
2018-05-18 19:30:32 | Rolf Campbell | set | messageid: <1526671832.2.0.682650639539.issue33547@psf.upfronthosting.co.za> |
2018-05-18 19:30:32 | Rolf Campbell | link | issue33547 messages |
2018-05-18 19:30:32 | Rolf Campbell | create | |
|