This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2016年08月30日 01:46 by terry.reedy, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| imports-27891.diff | terry.reedy, 2016年08月30日 08:40 | review | ||
| import-27891-2.diff | terry.reedy, 2016年08月31日 03:37 | revise 3 files, add README material | review | |
| Messages (8) | |||
|---|---|---|---|
| msg273892 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2016年08月30日 01:46 | |
PEP 8 suggests separately grouping stdlib, dependency, and local package imports. Within idlelib, idlelib imports are treated as local package imports. Tkinter is sometimes treated as a dependency, which makes its imports easy to notice, and I want to do this consistently. It is conventional to sort imports within each group. This is sometimes true now, sometimes not (even before the 3.6 renaming). The possible danger of rearranging imports is that a line gets deleted and not pasted. Rietveld's side-by-side diff should make this easy to detect. This issue is about re-arranging the imports currently at the top of a file, and any module level imports that I notice elsewhere. Dealing with delayed imports within functions and classed will be another issue, which will depend on this one. |
|||
| msg273895 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2016年08月30日 02:16 | |
This issue includes adding the idlelib import coding standard to idlelib.README. The delayed-import issue is #27893. A second followup will be to stop importing tkinter modules 'as' their Py 2 names. Change "from tkinter import font as TkFont" to "from tkinter import font" and globally replace 'TkFont' with 'tkfont'. Do the same for messagebox and any other submodules as needed. |
|||
| msg273897 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2016年08月30日 03:07 | |
On 2002 Sept 14, the following was merged into editor.py (then EditorWindow.py) as part of the smart indenting code added to the bottom. import tokenize _tokenize del tokenize This now would usually be written "import tokenize as _tokenize". Stdlib modules without explicit __all__ often do this to omit stdlib modules from their public interface. Idlelib does not do this. Add to README import standards. I put replaced the above with 'import tokenize' as the top where is belongs and changed all '_tokenize' to 'tokenize'. |
|||
| msg273905 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2016年08月30日 08:40 | |
Part of previous message should be 'at the top where it belongs'. With attached patch, each file compiles and (incomplete) tests pass. Will examine each with side-by-side diff. There might be artifacts from another patch left. |
|||
| msg273906 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2016年08月30日 08:44 | |
Followup is #27892 |
|||
| msg273994 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2016年08月31日 03:37 | |
Patch 2 has minor revisions to hyperparser, mainmenu, pyshell, and adds material to README.txt. |
|||
| msg274000 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年08月31日 04:51 | |
New changeset 96ac4cd43a20 by Terry Jan Reedy in branch 'default': Issue #27891: Consistently group and sort imports within idlelib modules. https://hg.python.org/cpython/rev/96ac4cd43a20 |
|||
| msg274078 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年08月31日 23:37 | |
New changeset 28ce37a2d888 by Terry Jan Reedy in branch 'default': Issue #27891: Tweak new idlelib README entry. https://hg.python.org/cpython/rev/28ce37a2d888 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:35 | admin | set | github: 72078 |
| 2016年08月31日 23:37:44 | python-dev | set | messages: + msg274078 |
| 2016年08月31日 04:52:07 | terry.reedy | set | status: open -> closed resolution: fixed stage: needs patch -> resolved |
| 2016年08月31日 04:51:12 | python-dev | set | nosy:
+ python-dev messages: + msg274000 |
| 2016年08月31日 03:37:34 | terry.reedy | set | files:
+ import-27891-2.diff messages: + msg273994 |
| 2016年08月30日 08:44:01 | terry.reedy | set | messages: + msg273906 |
| 2016年08月30日 08:40:41 | terry.reedy | set | files:
+ imports-27891.diff keywords: + patch messages: + msg273905 |
| 2016年08月30日 03:07:12 | terry.reedy | set | messages: + msg273897 |
| 2016年08月30日 02:16:10 | terry.reedy | set | messages: + msg273895 |
| 2016年08月30日 01:54:36 | terry.reedy | link | issue27892 dependencies |
| 2016年08月30日 01:46:59 | terry.reedy | create | |