Message273896
| Author |
terry.reedy |
| Recipients |
terry.reedy |
| Date |
2016年08月30日.02:27:04 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1472524024.9.0.822117850837.issue27892@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|