Maybe at first sight, but look:

Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) 
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
>>> C = 'red', 'green'
>>> [light is 'green' for light in C]
[False, False]

NB: I have to quit Python each time and reload to make sure the workspace 
hasn't been polluted by some other definition.

The problem is I teach the Python language, and this is no easy to explain 
behavior, unless it has something to do with interning strings for performance 
reasons in a for context, but even so, this isn't obvious for beginners.
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to