[Tutor] Misc question about scoping

ALAN GAULD alan.gauld at btinternet.com
Fri Jun 4 22:02:25 CEST 2010


> Are you arguing that the if/else form is better than simply casting 
> to bool because it is more explicit? 

No, I'm simply offering a reason to use if/else in the general sense.

In practice, for this specific case, I'd go with the bool(expr) form.

 Alan Gauld
Author of the Learn To Program website
http://www.alan-g.me.uk/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100604/4470bf48/attachment.html>


More information about the Tutor mailing list