Bug or feature: double strings as one

Grant Edwards invalid at invalid
Fri Aug 7 10:13:33 EDT 2009


On 2009-08-07, durumdara <durumdara at gmail.com> wrote:
> Hi!
>
> 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?

You "wanna"?

> In other languages, like Delphi (Pascal), Javascript, SQL, etc., I
> must concatenate the strings with some sign, like "+" or "||".

In other languages like Ruby, awk, C, C++, etc. adjacent string
constants are concatenated.

-- 
Grant Edwards                   grante             Yow! Is it clean in other
                                  at               dimensions?
                               visi.com            



More information about the Python-list mailing list