On Wed, Jan 7, 2009 at 7:22 PM, Terry Reedy <tjre...@udel.edu> wrote:

> Joe Strout wrote:
>
>  That's not necessarily true.  If you have
>>
>>  a = "par" + "rot"
>>  b = "parrot"
>>
>> then, most likely (though it depends on how clever the compiler
>> optimizations are), there are two different string objects containing the
>> data "parrot".
>>
>
> >>> a='par'+'rot'
> >>> b='parrot'
> >>> a is b
> True


(this is on Mono. I don't know if the real .NET and/or newer versions of
IronPython do this differently)

IronPython 1.1 (1.1) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
>>> a = "par" + "rot"
>>> b="parrot"
>>> a is b
False


>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to