pycln: cleanup of more imports#2342
Conversation
|
|
||
|
|
||
| from pywin.framework.editor.color.coloreditor import editorTemplate | ||
| import pywin.framework.editor.color.coloreditor # nopycln: import # Adds doc template |
There was a problem hiding this comment.
Assuming this side-effect is wanted here:
pywin32/Pythonwin/pywin/framework/editor/color/coloreditor.py
Lines 639 to 646 in 377a3ef
| from . import ( # nopycln: import # Injects fast_readline into the IDLE auto-indent extension | ||
| IDLEenvironment, | ||
| ) |
There was a problem hiding this comment.
If injecting in the extension isn't needed when IDLEenvironment isn't used directly (it's imported in a couple other places), then this can be removed.
| "pythoncom", | ||
| "pywintypes", | ||
| "win32api", | ||
| "win32clipboard", | ||
| "win32com", | ||
| "win32cryptcon", | ||
| "win32event", | ||
| "win32file", | ||
| "win32gui_struct", | ||
| "win32gui", | ||
| "win32inet", | ||
| "win32inetcon", | ||
| "win32pipe", | ||
| "win32ras", | ||
| "win32ui", | ||
| "win32process", | ||
| "win32security", | ||
| "win32uiole", |
There was a problem hiding this comment.
Do you know if any of these produce side-effects in a way one might want to import the module w/o using any of its symbols?
"pythoncom",
"pywintypes",
"win32api",
"win32file",
"win32gui",
"win32process",
"win32security",
"win32uiole",There was a problem hiding this comment.
pywintypes might for the loader, but I don't think the rest do.
There was a problem hiding this comment.
Noted. I'd like to merge this PR as-is w/o tackling additional changes in Python files, so I added it to the comment.
c88531e to
b0490f2
Compare
| "pythoncom", | ||
| "pywintypes", | ||
| "win32api", | ||
| "win32clipboard", | ||
| "win32com", | ||
| "win32cryptcon", | ||
| "win32event", | ||
| "win32file", | ||
| "win32gui_struct", | ||
| "win32gui", | ||
| "win32inet", | ||
| "win32inetcon", | ||
| "win32pipe", | ||
| "win32ras", | ||
| "win32ui", | ||
| "win32process", | ||
| "win32security", | ||
| "win32uiole", |
There was a problem hiding this comment.
pywintypes might for the loader, but I don't think the rest do.
See per-file comments for more details.
Some expanded star imports with lots of entries might be better as
import xinstead offrom x import a, b, c, ...