[FRPythoneers] Python documentation and default expression

Sean Reifschneider jafo at tummy.com
Fri Mar 15 15:16:13 MST 2002


On Fri, Mar 15, 2002 at 02:39:46PM -0700, Rob Riggs wrote:
>when I extended a class to include a __len__() member function. What I 
>really wanted to test was that the class wasn't "None", and using the 

In general, if I've set something to None and I want to check it, I will
use "if foo != None", for reasons that are now all too clear to you.  ;-)
I will use "if not foo" for some things, usually where I want to consider
an empty sequence to be the same as a None.  So, by defaut I use "if foo !=
None", unless I have a specific reason for wanting to check "if not foo".

Sean
-- 
 "Do you expect me to use emacs?"
 "No, Mr. Bond.  I expect you to vi!"
Sean Reifschneider, Inimitably Superfluous <jafo at tummy.com>
tummy.com - Linux Consulting since 1995. Qmail, KRUD, Firewalls, Python



More information about the FRPythoneers mailing list