[issue29929] Eliminate implicit __main__ relative imports

2017-06-06 Thread Ronald Oussoren
Ronald Oussoren added the comment: If only someone had access to the time machine keys to fix this 20 year ago :-(. Anything beyond that last option (recognising that the script tries to import itself under another name) is bound to run into odd issues or backward compatibility concerns.

[issue29929] Eliminate implicit __main__ relative imports

2017-06-05 Thread Nick Coghlan
Nick Coghlan added the comment: Ronald: that depends somewhat on how the installation is handled. For example, for entrypoints-style scripts, the entirety of __main__ is auto-generated anyway, and anyone using "./setup.py develop" or "pip install -e ." to add a suitable sys.path entry during

[issue29929] Eliminate implicit __main__ relative imports

2017-06-05 Thread Ronald Oussoren
Ronald Oussoren added the comment: A disadvantage of requiring "from . import ..." to import modules next to the script is that this requires a different mechanism before and after installation of a script. That is, before installation the additional modules are next to the script ("from .

[issue29929] Eliminate implicit __main__ relative imports

2017-06-03 Thread Chris Angelico
Changes by Chris Angelico : -- nosy: +Rosuav ___ Python tracker ___ ___ Python-bugs-list

[issue29929] Eliminate implicit __main__ relative imports

2017-06-03 Thread Nick Coghlan
Nick Coghlan added the comment: See https://mail.python.org/pipermail/import-sig/2017-March/001068.html for the above-mentioned import-sig post (the design in that email isn't the same as the one described above, but later in the thread I decided the design suggested here is likely to be less

[issue29929] Eliminate implicit __main__ relative imports

2017-03-28 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

[issue29929] Eliminate implicit __main__ relative imports

2017-03-28 Thread Nick Coghlan
Nick Coghlan added the comment: In formulating a post to import-sig about this, I realised it made more sense to describe it in terms of the goal (eliminating implicit __main__ relative imports) rather than one possible technique for achieving that goal. -- title: Idea: Make __main__