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

curses/textpad.py incorrectly and redundantly imports ascii #47489

Closed
orivej mannequin opened this issue Jun 29, 2008 · 7 comments
Closed

curses/textpad.py incorrectly and redundantly imports ascii #47489

orivej mannequin opened this issue Jun 29, 2008 · 7 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@orivej
Copy link
Mannequin

orivej mannequin commented Jun 29, 2008

BPO 3239
Nosy @facundobatista, @orivej
Files
  • curses-textpad-ascii.patch
  • 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/facundobatista'
    closed_at = <Date 2008-07-05.20:40:35.160>
    created_at = <Date 2008-06-29.21:28:31.988>
    labels = ['library']
    title = 'curses/textpad.py incorrectly and redundantly imports ascii'
    updated_at = <Date 2008-07-05.20:40:35.159>
    user = 'https://github.com/orivej'

    bugs.python.org fields:

    activity = <Date 2008-07-05.20:40:35.159>
    actor = 'facundobatista'
    assignee = 'facundobatista'
    closed = True
    closed_date = <Date 2008-07-05.20:40:35.160>
    closer = 'facundobatista'
    components = ['Library (Lib)']
    creation = <Date 2008-06-29.21:28:31.988>
    creator = 'orivej'
    dependencies = []
    files = ['10790']
    hgrepos = []
    issue_num = 3239
    keywords = ['patch']
    message_count = 7.0
    messages = ['68969', '68981', '68996', '68997', '69003', '69054', '69295']
    nosy_count = 2.0
    nosy_names = ['facundobatista', 'orivej']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3239'
    versions = ['Python 3.0']

    @orivej
    Copy link
    Mannequin Author

    orivej mannequin commented Jun 29, 2008

    Line 'import curses, ascii' should be replaced with 'import curses'

    @orivej orivej mannequin added the stdlib Python modules in the Lib dir label Jun 29, 2008
    @facundobatista
    Copy link
    Member

    The ascii module is used all around the file... if you don't import it,
    how would you use that functionality?

    @orivej
    Copy link
    Mannequin Author

    orivej mannequin commented Jun 30, 2008

    Sorry, I didn't not distinguish between curses module ascii and built-in
    function ascii.

    "import curses.ascii as ascii" works. Is this a good fix?

    @orivej
    Copy link
    Mannequin Author

    orivej mannequin commented Jun 30, 2008

    Or is it possible/better to use relative import?

    @facundobatista
    Copy link
    Member

    Ah, I now understand what you mean.

    The best, IMO, to avoid the confusion in the import and in the usage, is
    to do:

    >> import curses.ascii as curses_ascii

    Do you care to send a patch? Thank you!

    @orivej
    Copy link
    Mannequin Author

    orivej mannequin commented Jul 1, 2008

    >> import curses.ascii as curses_ascii

    If you like curses_ascii you would probably like curses.ascii :) so here
    is the patch. I tested it with module built-in testing facility (if
    __name__ == '__main__') but didn't run other tests.

    Patch with "patch -i curses-textpad-ascii.patch
    src/python/Lib/curses/textpad.py"

    @facundobatista
    Copy link
    Member

    Commited in r64746. Thank you!!

    @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
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant