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.

classification
Title: move test() in SimpleDialog.py
Type: Stage:
Components: Tkinter Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: loewis Nosy List: loewis, toxnx
Priority: low Keywords: patch

Created on 2004-03-07 00:16 by toxnx, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
SimpleDialog.diff toxnx, 2004-03-07 00:16 moved def test() under if __name__ == '__main__':
Messages (2)
msg45476 - (view) Author: tox-the-wanderer (toxnx) Date: 2004-03-07 00:16
The test function in SimpleDialog is named "test()" 
instead of "_test()".  Since it only is used to test the 
SimpleDialog class, at the very least it should be 
named "_test()" so it doesn't run the risk of overwriting 
a function by the same name when imported using "from 
SimpleDialog import *".

However, I propose that the function declaration for test
() be moved under "if __name__ == '__main__':", that 
way the function is explicitly not part of the SimpleDialog 
module.
msg45477 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-03-22 22:00
Logged In: YES 
user_id=21627

Thanks for the patch. Applied as SimpleDialog.py 1.5.
History
Date User Action Args
2022-04-11 14:56:03adminsetgithub: 40010
2004-03-07 00:16:33toxnxcreate