Bug or feature: double strings as one

Peter Otten __peter__ at web.de
Fri Aug 7 08:41:36 EDT 2009


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:

http://docs.python.org/reference/lexical_analysis.html#string-literal-concatenation

Peter




More information about the Python-list mailing list