[issue16846] relative import solution

2013-10-13 Thread Georg Brandl
Changes by Georg Brandl : -- status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue16846] relative import solution

2013-01-03 Thread Georg Brandl
Georg Brandl added the comment: David, the "issue" is that Python only allows relative imports within packages. The OP wants to have a.py and b.py in the same directory and then be able to said "from . import b" in the a module. This is a design decision and will not change without a PEP. --

[issue16846] relative import solution

2013-01-03 Thread R. David Murray
R. David Murray added the comment: Could you give more information about what you see as the bug, here? I'm not understanding the problem because there doesn't appear to be enough context. What is your directory structure? Where is the import happening? -- components: +Interpreter C

[issue16846] relative import solution

2013-01-02 Thread FizzledOut
New submission from FizzledOut: Instead of giving the error message " Attempted relative import in non-package", simply process the line! from . import Example whether or not the file is __main__, it should be able to go up one directory, if possible, and try to import Example.py. It makes n