Message273896
Another good reason for delaying an import is when the import is only needed for testing.
In module_x
...
def callable_x(parent) # htest #
from tkinter import Toplevel
box = Toplevel(parent)
...
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_module_x', verbosity=2)
from idlelib.idle_test.htest import run
run(callable_x)
This should be part of 'Import Standards' in idlelib.README. |
|
Date |
User |
Action |
Args |
2016-08-30 02:27:04 | terry.reedy | set | recipients:
+ terry.reedy |
2016-08-30 02:27:04 | terry.reedy | set | messageid: <1472524024.9.0.822117850837.issue27892@psf.upfronthosting.co.za> |
2016-08-30 02:27:04 | terry.reedy | link | issue27892 messages |
2016-08-30 02:27:04 | terry.reedy | create | |
|