On Sun, 10 Oct 2010 18:54:20 +0300, anatoly techtonik firstname.lastname@example.org wrote:
(The explanation of the failures applies for all Python versions that I am aware of, but the -m based fix only became available in 2.6) (The impact of various command line options and the PYTHONPATH environment variable on sys.path are described at http://docs.python.org/using/cmdline.html) (The basic import search algorithm is described in the tutorial: http://docs.python.org/tutorial/modules.html#the-module-search-path) (And the full gory specification details are in PEP 302, with a few subsequent tweaks courtesy of PEP 328 and PEP 366).
This what I call "zen of import".
I don't see why such awkward way should be necessary in Python 3k, which breaks backwards compatibility. Why it can't "just work" for my user story?
Because you weren't around advocating and implementing a change when Python 3 was developed?
It's too late now to arbitrarily break backward compatibility, so you'll have to advocate and develop any change inside the parameters of Python's normal backward compatibility policy.
In other words, you should move this discussion to python-ideas.
-- R. David Murray www.bitdance.com