'concatenating''strings'

Sean 'Shaleh' Perry shalehperry at attbi.com
Thu Aug 8 20:16:36 CEST 2002


On 08-Aug-2002 Will Stuyvesant wrote:
> Python 2.2.1 (#34, Apr  9 2002, 19:34:33) [MSC 32 bit (Intel)] on
> win32
> Type "copyright", "credits" or "license" for more information.
> IDLE 0.8 -- press F1 for help
>>>> '1''2'
> '12'
>>>> '1''2''3'
> '123'
>>>> '1'''
> '1'
>>>> '''3'
> KeyboardInterrupt
>>>> # that did hang with the cursor on the next line so I had to press
> CTRL-c
>>>> _
> '1'
>>>> ''+'3'
> '3'
> 
> Totally unimportant but unexpected behaviour.
> Looks like you can not concatenate the empty string '' to 'something'
> without using the + operator.
> 

um, zero + N => N.  What should empty string + string yield?  How would you
know that an empty string was there?  The current behavior makes perfect sense
to me.




More information about the Python-list mailing list