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.
Created on 2014年07月23日 19:57 by terry.reedy, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg223771 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2014年07月23日 19:57 | |
I propose to remove the following two lines with 'reload' from turtledemo.__main__.py. from importlib import reload ... ... def loadfile(self, filename): ... reload(self.module) Reloading modules each time a demo is run allows and even encourages module level code that initializes variables (other than classes) and has system side-effects. In particular, some such calls created the test problems reported in #21882. Code that needs to be run each time the required main() is called should be inside main. Indeed, reforming the two_canvases demo (see patch for #21882) made two_canvases work properly within the demo driver. With the demos patched, I tried them all twice after commenting out the reload. I did not notice any difference, except possibly faster response. I already edited the help text to tell users to initialize in main(). |
|||
| msg226335 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2014年09月03日 23:29 | |
New changeset b76d854f580e by Terry Jan Reedy in branch '2.7': Issue #22051: remove unneeded reload that allowed bad code. http://hg.python.org/cpython/rev/b76d854f580e New changeset 55d4f6c2be2d by Terry Jan Reedy in branch '3.4': Issue #22051: remove unneeded reload that allowed bad code. http://hg.python.org/cpython/rev/55d4f6c2be2d |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:06 | admin | set | github: 66250 |
| 2018年06月29日 03:46:27 | terry.reedy | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2014年09月03日 23:29:57 | python-dev | set | nosy:
+ python-dev messages: + msg226335 |
| 2014年07月23日 20:11:55 | terry.reedy | link | issue14117 dependencies |
| 2014年07月23日 19:57:46 | terry.reedy | create | |