Issue 3239: curses/textpad.py incorrectly and redundantly imports ascii (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/47489

classification

Title: curses/textpad.py incorrectly and redundantly imports ascii
Type: Stage:
Components: Library (Lib) Versions: Python 3.0

process

Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: facundobatista Nosy List: facundobatista, orivej
Priority: normal Keywords: patch

Created on 2008-06-29 21:28 by orivej, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
curses-textpad-ascii.patch orivej,2008-07-01 17:47
Messages (7)
msg68969 - (view) Author: Orivej Desh (orivej) * Date: 2008-06-29 21:28
Line 'import curses, ascii' should be replaced with 'import curses'
msg68981 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-06-30 01:08
The ascii module is used all around the file... if you don't import it, how would you use that functionality?
msg68996 - (view) Author: Orivej Desh (orivej) * Date: 2008-06-30 06:54
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?
msg68997 - (view) Author: Orivej Desh (orivej) * Date: 2008-06-30 06:55
Or is it possible/better to use relative import?
msg69003 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-06-30 12:05
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!
msg69054 - (view) Author: Orivej Desh (orivej) * Date: 2008-07-01 17:47
>>> 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"
msg69295 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-07-05 20:40
Commited in r64746. Thank you!!
History
Date User Action Args
2022-04-11 14:56:36 admin set github: 47489
2008-07-05 20:40:35 facundobatista set status: open -> closedresolution: acceptedmessages: +
2008-07-01 17:47:12 orivej set files: + curses-textpad-ascii.patchkeywords: + patchmessages: +
2008-06-30 12:05:07 facundobatista set status: closed -> openassignee: facundobatistaresolution: not a bug -> (no value)messages: +
2008-06-30 06:55:38 orivej set messages: +
2008-06-30 06:54:25 orivej set messages: +
2008-06-30 01:08:42 facundobatista set status: open -> closedresolution: not a bugmessages: + nosy: + facundobatista
2008-06-29 21:28:32 orivej create