[Tutor] not operator

Steve Willoughby steve at alchemy.com
Fri Sep 19 01:22:33 CEST 2008

On Thu, Sep 18, 2008 at 07:19:29PM -0400, christopher.henk at allisontransmission.com wrote:
> if not os.access(target_dir, os.F_OK):
> if os.access(target_dir, os.F_OK)==False:
> if os.access(target_dir, os.F_OK)!=True:

IMHO it's generally bad form to use numeric == or != operators to compare
values against True, False, and None.  I'd really strongly encourage
the first form.  Your mileage may vary, of course.

Steve Willoughby    |  Using billion-dollar satellites
steve at alchemy.com   |  to hunt for Tupperware.

More information about the Tutor mailing list