classification
Title: add lib2to3/__main__.py
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: belopolsky, benjamin.peterson, brett.cannon, eric.araujo
Priority: low Keywords: easy, patch

Created on 2011-01-31 20:52 by brett.cannon, last changed 2011-02-22 19:20 by brett.cannon. This issue is now closed.

Files
File name Uploaded Description Edit
2to3_main.diff brett.cannon, 2011-01-31 21:05 Add Lib/lib2to3/__main__.py and patch Tools/scripts/2to3
Messages (9)
msg127659 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2011-01-31 20:52
There is no reason why the 2to3 script can't be gutted and turned into just a stub that uses runpy to call lib2to3.__main__. Also has the nice benefit that one can use ``-m lib2to3`` instead of having to use the 2to3 script.
msg127663 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2011-01-31 21:05
The attached patch adds lib2to3.__main__ and tweaks 2to3.
msg127669 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2011-01-31 22:49
Uh, I must say I find typing "lib2to3" quite ugly.
msg127670 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2011-01-31 22:52
I don't find it ideal either, but ``python -m lib2to3`` gives complete control over which VM is used since it's specified right on the command line. I don't expect this to become the common way to invoke 2to3, just **a** way to invoke it.
msg127680 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2011-02-01 04:06
It is unfortunate that the cute name for the tool is not valid as a module name.  How about renaming "lib2to3" to "to3".  The offending leading digit is strictly redundant (there is no 1to3 after all).
msg127683 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2011-02-01 05:10
Would needlessly break code for such a minor perk. I mean I doubt very many people will use this feature if it goes in. It's just rather nice for those who do want the feature to exist in the first place.
msg127912 - (view) Author: √Čric Araujo (eric.araujo) * (Python committer) Date: 2011-02-04 17:46
+1.  Not sure this needs unit tests; I suppose you plan to add a note to the docs.
msg127932 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2011-02-04 20:04
Yeah, probably some little mention in the docs.
msg129113 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2011-02-22 19:20
r88503 has the patch in 3.3

Didn't both with documenting it since I only expect core devs who are debugging something with 2to3 will want to use this approach.
History
Date User Action Args
2011-02-22 19:20:35brett.cannonsetstatus: open -> closed
nosy: brett.cannon, belopolsky, benjamin.peterson, eric.araujo
messages: + msg129113

assignee: brett.cannon
resolution: fixed
stage: commit review -> resolved
2011-02-04 20:04:44brett.cannonsetnosy: brett.cannon, belopolsky, benjamin.peterson, eric.araujo
messages: + msg127932
2011-02-04 17:46:32eric.araujosetnosy: + eric.araujo
messages: + msg127912
2011-02-01 05:10:30brett.cannonsetmessages: + msg127683
2011-02-01 04:06:24belopolskysetnosy: + belopolsky
messages: + msg127680
2011-01-31 22:53:05brett.cannonsetstage: needs patch -> commit review
2011-01-31 22:52:58brett.cannonsetmessages: + msg127670
2011-01-31 22:49:33benjamin.petersonsetmessages: + msg127669
2011-01-31 21:50:24pitrousetnosy: + benjamin.peterson
2011-01-31 21:05:59brett.cannonsetfiles: + 2to3_main.diff

messages: + msg127663
keywords: + patch
2011-01-31 20:52:47brett.cannoncreate