is and ==
aahz at panix.com
Mon Feb 26 11:45:30 EST 2001
In article <movk9t0una5nuca6upgk9rcco96fbkeu51 at 4ax.com>,
Daniel Klein <danielk at aracnet.com> wrote:
>Is there a functional difference between 'is' and '==' ? If there is, I can't
>>> a = 'xy'
>>> b = a
>>> c = 'x' + 'y'
>>> d = 'xy'
>>> a is b
>>> a is d
>>> a is c
>>> a == c
Essentially, is tests for object identity: are two variables pointing to
the same location in memory. == tests to see whether the *values* are
--- Aahz (Copyright 2001 by aahz at pobox.com)
Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6
"I used to have a .sig but I found it impossible to please everyone..." --SFJ
More information about the Python-list