Hi, Mike,

On Sep 9, 2008, at 9:34 PM, Mike Hansen wrote:

>> What's the difference between "==" and "is" (or, more to the point:
>> where is this discussed)?
>
> This is a Python thing as "==" is equality testing and "is" is memory
> address testing.  For example,
>
> sage: a = 2
> sage: b = 2
> sage: a == b
> True
> sage: id(a)
> 54737440
> sage: id(b)
> 54735856
> sage: a is b
> False
>
> In Python, None, True, and False are all unique so you should use "is"
> with them since it is just a pointer check.

I think I actually once knew this.  I hope that is the case again soon.

Thanks for the clarification.

Justin

--
Justin C. Walker, Curmudgeon-at-Large
() The ASCII Ribbon Campaign
/\ Help Cure HTML Email




--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to