[Tutor] is vs. ==

Sean 'Shaleh' Perry shalehperry@attbi.com
Thu, 18 Apr 2002 20:43:12 -0700 (PDT)


On 19-Apr-2002 Ian! wrote:
> What's the difference between "is" and "=="? I always assumed they were the
> same.
> 
>>>> __name__ == '__main__'
> 1
>>>> __name__ is '__main__'
> 0
>>>>


'==' asks 'is this value equivalent to this other one'
'is' asks 'is this item the same item as this other one'