View Single Post
Old 07-05-2014, 09:17 AM   #865
tkeo
Connoisseur
tkeo began at the beginning.
 
Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
Hi Kevin,

Sorry, I missed to look at this post.
I will chage in future posts.

Quote:
Originally Posted by KevinH View Post
In an effort to help track down other mistakes like that, I have changed the entire code base to use the python.org PEP recommendation when testing against None as follows:

I have changed all:
== None
to:
is None

And changed all:
!= None
to:
is not None

Now any testing against 0 vs non-zero using "if variable" will stand out as different and I can track down any such occurrences to make sure they were not using it to test against None but were instead looking at the non-zero case.

I have attached a patch to move us to follow the python PEP recommendation.
See pep_use_patch.txt

Last edited by tkeo; 07-06-2014 at 06:25 AM. Reason: fixed typo.
tkeo is offline   Reply With Quote