On Fri, Jan 23, 2009 at 6:49 PM, Steven D'Aprano <
st...@remove-this-cybersource.com.au> wrote:

> On Fri, 23 Jan 2009 14:58:34 -0500, Gerald Britton wrote:
>
> > Hi -- Some time ago I ran across a comment recommending using <var> is
> > None instead of <var> == None (also <var> is not None, etc.)
>
> That entirely depends on whether you wish to test for something which
> *is* None or something with *equals* None. Those two things have
> different meanings.
>
> I wonder, do newbies actually get the impression from somewhere that "is"
> is a synonym for "=="?
>


I think it's more that teachers tell students without programming experience
"always use == to test if something equals something else unless you're
checking for None," without explaining what == and is actually mean.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to