Re: Bug or feature: double strings as one

2009-08-09 Thread MRAB
Jan Kaliszewski wrote: 09-08-2009 o 23:43:14 r wrote: #-- el bueno --# "hello i am a very long string that\ does not like newlines so please \ escape me, Thank you!" You probably ment: """hello i am... [etc.] Anyway... You're right that generally it's good idea to define dialog prompts and

Re: Bug or feature: double strings as one

2009-08-09 Thread Jan Kaliszewski
09-08-2009 o 23:43:14 r wrote: #-- el bueno --# "hello i am a very long string that\ does not like newlines so please \ escape me, Thank you!" You probably ment: """hello i am... [etc.] Anyway... You're right that generally it's good idea to define dialog prompts and such stuff separately ra

Re: Bug or feature: double strings as one

2009-08-09 Thread r
#-- el bueno --# "hello i am a very long string that\ does not like newlines so please \ escape me, Thank you!" #-- el malo --# "hello i am a very long string that"+ "does not like newlines but i have no"+ "idea what to do with myself" #-- el feo --# "hello i am a very long string that" "does no

Re: Bug or feature: double strings as one

2009-08-09 Thread r
On Aug 9, 12:10 pm, "Jan Kaliszewski" wrote: ..(snip) > Sorry, you are wrong, '''-way would be usefull only if: > >      * you want to have '\n' in each place where you wrap the >        literal in your code, > > and > >      * you use '''-literal at a module (non-indented) level > >        or you

Re: Bug or feature: double strings as one

2009-08-09 Thread Jan Kaliszewski
09-08-2009 r wrote: On Aug 8, 12:43 pm, "Jan Kaliszewski" wrote: 08-08-2009 Steven D'Aprano wrote: ...(snip) I use it very often, e.g.:          afunction('quite long string %s quite long string '                    'quite long string quite long string %s '                    'quite %s lo

Re: Bug or feature: double strings as one

2009-08-09 Thread Anny Mous
r wrote: > On Aug 8, 12:43 pm, "Jan Kaliszewski" wrote: >> (Note that multiline-'''-strings are usless in such cases). >> > > uhh? A much better way to handle such a problem is like this... > > prompt1 = ''' > Some people like to use %s > ways of doing things just > so they can support their %

Re: Bug or feature: double strings as one

2009-08-09 Thread r
On Aug 8, 12:43 pm, "Jan Kaliszewski" wrote: > 08-08-2009 Steven D'Aprano wrote: ...(snip) > I use it very often, e.g.: > >          afunction('quite long string %s quite long string ' >                    'quite long string quite long string %s ' >                    'quite %s long string quite

Re: Bug or feature: double strings as one

2009-08-08 Thread Jan Kaliszewski
08-08-2009 Steven D'Aprano wrote: On Fri, 07 Aug 2009 17:35:28 +, kj wrote: I fail to see why x = ("first part of a very long string " "second part of a very long string") That's done by the compiler at compile time and is fast. Moreover, it's also more readable, when you use st

Re: Bug or feature: double strings as one

2009-08-08 Thread Elias Fotinis (eliasf)
"Carl Banks" wrote: http://www.geocities.com/connorbd/tarpit/magentaaarm.html (It's on Geocities, yikes, someone better archive that) http://web.archive.org/web/*/http://www.geocities.com/connorbd/tarpit/magentaaarm.html :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug or feature: double strings as one

2009-08-08 Thread Mark Lawrence
Unknown wrote: On 2009-08-07, Scott David Daniels wrote: Grant Edwards wrote: On 2009-08-07, durumdara wrote: 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. adj

Re: Bug or feature: double strings as one

2009-08-07 Thread Carl Banks
On Aug 7, 10:00 am, Grant Edwards wrote: > On 2009-08-07, Scott David Daniels wrote: > > > Grant Edwards wrote: > >> On 2009-08-07, durumdara wrote: > >>> In other languages, like Delphi (Pascal), Javascript, SQL, etc., I > >>> must concatenate the strings with some sign, like "+" or "||". > > >

Re: Bug or feature: double strings as one

2009-08-07 Thread r
On Aug 7, 10:31 pm, Steven D'Aprano wrote: ...(snip excessive showmanship) :-) Ah Steven thats a real nice "snappy comeback" and some may get blinded by the "black magic" but basically all you are saying is that "version a" takes less overhead than "version b", compilation wise... but let's dig a

Re: Bug or feature: double strings as one

2009-08-07 Thread Steven D'Aprano
On Fri, 07 Aug 2009 17:35:28 +, kj wrote: > I fail to see why > > x = ("first part of a very long string " > "second part of a very long string") That's done by the compiler at compile time and is fast. > is so much better than > > x = ("first part of a very long string " + > "se

Re: Bug or feature: double strings as one

2009-08-07 Thread r
It sure doesn't get any more obivous than... "string1" + "string2" Although i much prefer string formatting to concatenation for almost all cases except the most simple. This auto-magic conacatenation of strings is unintuitive and completely moronic if you ask my opinion. I blow chunks when i se

Re: Bug or feature: double strings as one

2009-08-07 Thread r
On Aug 7, 7:31 am, durumdara wrote: > Hi! > > I found an interesting thing in Python. > Today one of my "def"s got wrong result. ...(snip) I think it's a completely useless feature and i have never used it even once! This so-called "feature" seems a direct contridiction to the zen... """There s

Re: Bug or feature: double strings as one

2009-08-07 Thread John Machin
On Aug 8, 3:43 am, alex23 wrote: > kj wrote: > > 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 p

Re: Bug or feature: double strings as one

2009-08-07 Thread Bearophile
durumdara: > I wanna ask that is a bug or is it a feature? For me it's a bug-prone antifeature. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug or feature: double strings as one

2009-08-07 Thread Duncan Booth
Grant Edwards wrote: > Definitely. Not only does it have _all_ the features, it even > manages to simultaneously have several mutually-exclusive > features. Sounds a bit like Perl. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug or feature: double strings as one

2009-08-07 Thread alex23
kj wrote: > 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 par

Re: Bug or feature: double strings as one

2009-08-07 Thread kj
In Peter Otten <__pete...@web.de> 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 strin

Re: Bug or feature: double strings as one

2009-08-07 Thread Grant Edwards
On 2009-08-07, Scott David Daniels wrote: > Grant Edwards wrote: >> On 2009-08-07, durumdara wrote: >>> 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. adja

Re: Bug or feature: double strings as one

2009-08-07 Thread Scott David Daniels
Grant Edwards wrote: On 2009-08-07, durumdara wrote: 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. I must learn thi

Re: Bug or feature: double strings as one

2009-08-07 Thread Grant Edwards
On 2009-08-07, durumdara 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

Re: Bug or feature: double strings as one

2009-08-07 Thread Peter Otten
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

Re: Bug or feature: double strings as one

2009-08-07 Thread Diez B. Roggisch
durumdara schrieb: 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

Bug or feature: double strings as one

2009-08-07 Thread durumdara
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? In