'if name is not None:' v. 'if name:'

Reedick, Andrew jr9445 at ATT.COM
Tue Jul 15 16:21:24 EDT 2008



> -----Original Message-----
> From: python-list-bounces+jr9445=att.com at python.org [mailto:python-
> list-bounces+jr9445=att.com at python.org] On Behalf Of Reedick, Andrew
> Sent: Tuesday, July 15, 2008 4:13 PM
> To: Victor Noagbodji; python-list at python.org
> Subject: RE: 'if name is not None:' v. 'if name:'
> 


> If name:
>     Then either
>         a) name is an object, and that object does not have a 'false'
> value, such as False, zero, or empty.
>           or
>         b) name is NULL/None.  No object.
 


Change that to: 

If not name:
    Then either
        a) name is an object, and that object does not have a 'false'
value, such as False, zero, or empty.
          or
        b) name is NULL/None.  No object.






More information about the Python-list mailing list