Hi Justin,

> 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.

--Mike

--~--~---------~--~----~------------~-------~--~----~
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