Thread: Python brevity
View Single Post
Old May 22nd, 2006, 9:40 AM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
if found is not None
means: if 'found' is not the same object as 'None'
if found != None
means: 'found' is not equal to 'None'

I am a total Python noob. That means ignorant, or uninformed; not stupid. Please do not mislead me while I'm trying to learn, whether it's to promote yourself as a guru, or high-priest, or for any other reason. If you care to give a rational dissertation on why one of the above is safer than the other (particularly in this circumstance), please feel free to do so. I'll certainly read it with all my attention.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote