what is the keyword "is" for?

Sion Arrowsmith siona at chiark.greenend.org.uk
Wed Aug 16 08:07:42 EDT 2006


Simon Forman <rogue_pedro at yahoo.com> wrote:
>Python 2.4.3 (#2, Apr 27 2006, 14:43:58)
>[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
>Type "help", "copyright", "credits" or "license" for more information.
>
>|>> a = b = 1e1000 / 1e1000
>|>> a is b
>True
>|>> a == b
>False

I agree with you:

$ python
Python 2.4.1 (#2, May  5 2005, 11:32:06)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = b = 1e1000 / 1e1000
>>> a is b
True
>>> a == b
False

Or maybe I don't:

$ python2.3
Python 2.3.5 (#2, Sep  4 2005, 22:01:42)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = b = 1e1000 / 1e1000
>>> a is b
True
>>> a == b
True

See:

http://mail.python.org/pipermail/python-bugs-list/2004-February/022133.html

-- 
\S -- siona at chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump



More information about the Python-list mailing list