Message270676
| Author | brett.cannon |
|---|---|
| Recipients | brett.cannon, eric.snow, m.nijland, ncoghlan, r.david.murray |
| Date | 2016-07-18.02:36:14 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1468809375.06.0.740209106884.issue27543@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
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). |
|
| History | |||
|---|---|---|---|
| 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 | |