On 20.11.12 12:39, Nick Coghlan wrote:
On Tue, Nov 20, 2012 at 7:06 PM, Kristján Valur Jónsson <krist...@ccpgames.com <mailto:krist...@ccpgames.com>> wrote:

    I’m intrigued.  I thought this was merely so that one could do

    python –m mypackage.mysubpackage

    Can you refer me to the rationale and discussion about this feature?


It was part of a fairly long progression in changes to the command line execution support :)

Top level package execution with -m came first in 2.4, arbitrary package execution for -m arrived in 2.5 (along with the runpy module), directory and zipfile execution (by supplying a valid sys.path entry as the "script" command line argument) was added in 2.6/3.0, and finally officially supported package execution via -m only arrived in 2.7 and 3.1 (a broken version of the last accidentally existed in 2.5, but that was just a mistake that arose when merging the import emulations in runpy and pkgutil, and had a side effect that violated at least one of the import system invariants).

In the specific case of directory and zipfile execution, discussion happened on the tracker: http://bugs.python.org/issue1739468

It was never brought up on python-dev because Guido was participating directly in the tracker discussion. Unfortunately, we then also forgot to mention it in the original version of the 2.6 What's New doc, so the vast majority of people missed the addition :(

Hi Nick,

thank you very much for this story and the link to the issue tracker!
A very good move for Python which is really not mentioned enough
to make people more aware of a great feature.

I think part of this discussion should get a more prominent place
for gems that can be found without knowing what to search. ;-)

Is the issue tracker permanent enough to reference it?
Maybe there could be some auxiliary info page with proper keywords
that collects links to relevant discussions like this.
Do we have such a thing already?

ciao - chris

--
Christian Tismer             :^)   <mailto:tis...@stackless.com>
Software Consulting          :     Have a break! Take a ride on Python's
Karl-Liebknecht-Str. 121     :    *Starship* http://starship.python.net/
14482 Potsdam                :     PGP key -> http://pgp.uni-mainz.de
phone +49 173 24 18 776  fax +49 (30) 700143-0023
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to