Message270676
So the problem is that you doing `from .a import test` and not `from . import a; test = a.test`. Whenever you do `from X import Y`, import actually imports X. Since X wasn't in sys.modules, it performs a proper import which means it sets the attribute on the package accordingly. But had Y been what you were after, then import simply looks for the Y attribute on the package instead of doing a full import.
IOW everything is working as expected (and I still wish people weren't allowed to import objects out of modules directly). |
|
Date |
User |
Action |
Args |
2016-07-18 02:36:15 | brett.cannon | set | recipients:
+ brett.cannon, ncoghlan, r.david.murray, eric.snow, m.nijland |
2016-07-18 02:36:15 | brett.cannon | set | messageid: <1468809375.06.0.740209106884.issue27543@psf.upfronthosting.co.za> |
2016-07-18 02:36:15 | brett.cannon | link | issue27543 messages |
2016-07-18 02:36:14 | brett.cannon | create | |
|