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 2008-07-05 20:40 by facundobatista. 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: Georgij Kondratjev (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: Georgij Kondratjev (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: Georgij Kondratjev (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: Georgij Kondratjev (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
2008-07-05 20:40:35facundobatistasetstatus: open -> closed
resolution: accepted
messages: + msg69295
2008-07-01 17:47:12orivejsetfiles: + curses-textpad-ascii.patch
keywords: + patch
messages: + msg69054
2008-06-30 12:05:07facundobatistasetstatus: closed -> open
assignee: facundobatista
resolution: not a bug -> (no value)
messages: + msg69003
2008-06-30 06:55:38orivejsetmessages: + msg68997
2008-06-30 06:54:25orivejsetmessages: + msg68996
2008-06-30 01:08:42facundobatistasetstatus: open -> closed
resolution: not a bug
messages: + msg68981
nosy: + facundobatista
2008-06-29 21:28:32orivejcreate