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.

Author terry.reedy
Recipients terry.reedy
Date 2016-07-16.23:19:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This issue continues #25507.  I still want to reduce the number of modules imported when starts a user process and the time they require.  In the process, I expect to reduce the number of tkinter module imports that need to be reversed and thereby make parts of the #25507 fix unnecessary.

"New changeset 93d325c64104 by Terry Jan Reedy in branch 'default':
Issue #25507: Move 4 objects from pyshell to run and switch inports."

This commit for #25507 was not needed for the fix I eventually choose, but it reduced the size of sys.modules in the user process from 193 to 156.  I have since determined that it reduced the time for startup imports on my machine from .45 to .25 seconds.  I now regard it as the first patch for this issue.

The attached file was explained in msg270522.  This and similar refactorings should be done when or after I have otherwise revised the module and tests in question.

For a Windows build of repository 3.6, importing tkinter into a fresh python process increases len(sys.modules) from 41 to 65.  But run only imports tkinter so it can call _tkinter.tkapp().eval('update') in its interactive input loop.  If other indirect imports were eliminated, I suspect _tkinter could be imported instead.
Date User Action Args
2016-07-16 23:19:17terry.reedysetrecipients: + terry.reedy
2016-07-16 23:19:16terry.reedysetmessageid: <>
2016-07-16 23:19:16terry.reedylinkissue27534 messages
2016-07-16 23:19:16terry.reedycreate