Title: move test() in
Type: Stage:
Components: Tkinter Versions: Python 2.3
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 2004-03-22 22:00 by loewis. This issue is now closed.

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 
msg45477 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-03-22 22:00
Logged In: YES 

Thanks for the patch. Applied as 1.5.
Date User Action Args
2004-03-07 00:16:33toxnxcreate