[Python-ideas] Outside the box string formatting idea

Ron Adam ron3200 at gmail.com
Mon Aug 10 00:59:08 CEST 2015



On 08/09/2015 06:06 PM, Alexander Belopolsky wrote:
> On Sun, Aug 9, 2015 at 5:20 PM, Ron Adam<ron3200 at gmail.com>  wrote:
>> >(% 'My name is ' name ', my age next year is ' (age+1)
> This reminds me Javascript's automatic string promotion:
>
> $ node
>> >name = 'Bob'
> 'Bob'
>> >age = 5
> 5
>> >'My name is ' + name + ', my age next year is ' + (age+1)
> 'My name is Bob, my age next year is 6'

It would only do that in a very narrow context.  I'm not suggesting it be 
done outside of string format expressions.

Cheers,
    Ron



More information about the Python-ideas mailing list