[Tutor] Is "var = None" in Python equivalent to "Set var
John Fouhy
john at fouhy.net
Mon Jun 30 01:19:56 CEST 2008
On 30/06/2008, wesley chun <wescpy at gmail.com> wrote:
> (this is a completely tangential thread, but i'm curious if the
> beginners -- not the experts -- are familiar with the difference
> between "if obj == None" vs. "if obj is None".)
As I understand it there are no cases where obj==None and obj is None
will give different results (which is not true for == vs is in
general), so is there any practical difference? Maybe you save a
handful of cycles?
--
John.
More information about the Tutor
mailing list