[Tutor] Negative IF conditions

Ron Phillips RPhillips at engineer.co.summit.oh.us
Mon Feb 14 12:48:09 CET 2005


And now for something only slightly different: education research shows
that people process "positives" far more quickly and accurately than
"negatives", so for readability I often code like:
 
if os.path.exists('filename')
    #no-operation
else
    #operation
 
YMMV, of course.
 
Ron

At 08:52 AM 2/11/2005, Mark Brown wrote:
Hi,
I'm a newbie and was wondering which of these IF conditions is better
structure:
if not os.path.exists('filename'): 

if os.path.exists('filename') == False: 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050214/1322abec/attachment.htm


More information about the Tutor mailing list