On Aug 14, 4:42 pm, Christian Heimes <[EMAIL PROTECTED]> wrote:
> Integers
> between -5 and +256 are singletons as are some other objects like
> strings with one element or empty tuples.

Not quite.

Python 2.5.2 (r252:60911, May 28 2008, 08:35:32)
[GCC 4.2.4 (Debian 4.2.4-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 'A'
>>> b = "%c" % a
>>> a
'A'
>>> b
'A'
>>> a is b
False


> You must not rely on the
> optimization.

Good advice.


Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to