Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lib2to3/__main__.py #55295

Closed
brettcannon opened this issue Jan 31, 2011 · 9 comments
Closed

add lib2to3/__main__.py #55295

brettcannon opened this issue Jan 31, 2011 · 9 comments
Assignees
Labels
easy stdlib Python modules in the Lib dir

Comments

@brettcannon
Copy link
Member

BPO 11086
Nosy @brettcannon, @abalkin, @benjaminp, @merwok
Files
  • 2to3_main.diff: Add Lib/lib2to3/main.py and patch Tools/scripts/2to3
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/brettcannon'
    closed_at = <Date 2011-02-22.19:20:35.866>
    created_at = <Date 2011-01-31.20:52:47.090>
    labels = ['easy', 'library']
    title = 'add lib2to3/__main__.py'
    updated_at = <Date 2011-02-22.19:20:35.857>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2011-02-22.19:20:35.857>
    actor = 'brett.cannon'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2011-02-22.19:20:35.866>
    closer = 'brett.cannon'
    components = ['Library (Lib)']
    creation = <Date 2011-01-31.20:52:47.090>
    creator = 'brett.cannon'
    dependencies = []
    files = ['20636']
    hgrepos = []
    issue_num = 11086
    keywords = ['patch', 'easy']
    message_count = 9.0
    messages = ['127659', '127663', '127669', '127670', '127680', '127683', '127912', '127932', '129113']
    nosy_count = 4.0
    nosy_names = ['brett.cannon', 'belopolsky', 'benjamin.peterson', 'eric.araujo']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue11086'
    versions = ['Python 3.3']

    @brettcannon
    Copy link
    Member Author

    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.

    @brettcannon brettcannon added stdlib Python modules in the Lib dir easy labels Jan 31, 2011
    @brettcannon
    Copy link
    Member Author

    The attached patch adds lib2to3.__main__ and tweaks 2to3.

    @benjaminp
    Copy link
    Contributor

    Uh, I must say I find typing "lib2to3" quite ugly.

    @brettcannon
    Copy link
    Member Author

    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.

    @abalkin
    Copy link
    Member

    abalkin commented Feb 1, 2011

    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).

    @brettcannon
    Copy link
    Member Author

    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.

    @merwok
    Copy link
    Member

    merwok commented Feb 4, 2011

    +1. Not sure this needs unit tests; I suppose you plan to add a note to the docs.

    @brettcannon
    Copy link
    Member Author

    Yeah, probably some little mention in the docs.

    @brettcannon
    Copy link
    Member Author

    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.

    @brettcannon brettcannon self-assigned this Feb 22, 2011
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    easy stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants