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.

classification
Title: unnecessary re-imports
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jayvdb, python-dev
Priority: normal Keywords: patch

Created on 2015-10-29 01:55 by jayvdb, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
re-imports.diff jayvdb, 2015-10-29 01:55 Remove unnecessary re-imports review
re-imports.diff jayvdb, 2015-10-29 05:43 Add Parser/asdl_c.py review
Messages (2)
msg253651 - (view) Author: John Mark Vandenberg (jayvdb) * Date: 2015-10-29 01:55
The following four modules re-import another module unnecessarily as it is already imported in the global scope.

Lib/getpass.py : msvcrt
Lib/pickletools.py : sys
Lib/smtplib.py : sys
PC/testpy.py : os

In each case, the import being removed in the attached patch existed in the source code before the import which now occurs first.  i.e. an import was added and the same import elsewhere in the module was not removed.
msg253658 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-10-29 06:17
New changeset dec0a26d0b4d by Benjamin Peterson in branch '3.5':
remove duplicated imports (closes #25502)
https://hg.python.org/cpython/rev/dec0a26d0b4d

New changeset 695c50c8cc92 by Benjamin Peterson in branch 'default':
merge 3.5 (#25502)
https://hg.python.org/cpython/rev/695c50c8cc92
History
Date User Action Args
2022-04-11 14:58:23adminsetgithub: 69688
2015-10-29 06:17:58python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg253658

resolution: fixed
stage: resolved
2015-10-29 05:43:05jayvdbsetfiles: + re-imports.diff
2015-10-29 01:55:45jayvdbcreate