In <[email protected]> Peter Otten <[email protected]> writes:
>durumdara wrote:
>> I found an interesting thing in Python.
>> Today one of my "def"s got wrong result.
>>
>> When I checked the code I saw that I miss a "," from the list.
>>
>> l = ['ó' 'Ã']
>>
>> Interesting, that Python handle them as one string.
>>
>> print ['ó' 'Ã']
>> ['\xf3\xd3']
>>
>> I wanna ask that is a bug or is it a feature?
Feature, as others have pointed out, though I fail to see the need
for it, given that Python's general syntax for string (as opposed
to string literal) concatenation is already so convenient. I.e.,
I fail to see why
x = ("first part of a very long string "
"second part of a very long string")
is so much better than
x = ("first part of a very long string " +
"second part of a very long string")
FWIW, C has the same concatenation feature for string literals.
E.g., the following is valid C:
printf("first part of a very long string "
"second part of a very long string\n");
kynn
--
http://mail.python.org/mailman/listinfo/python-list