converting a nested try/except statement into try/except/else

Boris Borcic bborcic at gmail.com
Thu Aug 10 18:04:49 EDT 2006


Boris Borcic wrote:
> John Salerno wrote:
>> In this case the method must return False, because it's a wxPython 
>> method that needs a True or False value. If it doesn't, the program 
>> will continue even after the error message.
> 
> Just as it should do if the method returns True and no error message is 
> produced if I understand you well... Are you sure ? I don't know 
> wxPython, but this strikes me as surprisingly unpythonic behavior.

I just verified on the wxWindows demo I had somehow installed on my box, that 
indeed returning None appears to produce the same behavior as returning True, 
distinct from the behavior obtained by returning False. Ugh...



More information about the Python-list mailing list