RE: [Python-Dev] PEP 292, Simpler String Substitutions
LOL. Youre right of course :) `...` is already in python though. Better to generalise and/or extend an already existing construct than to add a new one, I would assert. Youre also right about `...` being less visible than other pairs of delimiters. I think, though, that if modifying the % notation, that the requirement should be for delimiters that are not parentheses, and ones that wouldn't interfere with putting expressions between them. This would allow for eval()ing the content between the delimiters.
-----Original Message----- From: guido@pcp02138704pcs.reston01.va.comcast.net [mailto:guido@pcp02138704pcs.reston01.va.comcast.net] On Behalf Of Guido van Rossum Sent: Thursday, 20 June 2002 00:08 To: Damien Morton Subject: Re: [Python-Dev] PEP 292, Simpler String Substitutions
I stand by my position though. Ive been programing for a long time, and I have rarely come across the $ notation. Mind you, I don't work in unix very often, and I would hazard a guess that the $ substitution comes mainly from unix.
So does `...`. :-)
--Guido van Rossum (home page: http://www.python.org/~guido/)
`...` is already in python though.
But not in this form.
Better to generalise and/or extend an already existing construct than to add a new one, I would assert.
Only if that construct is successful. `...` has a bad rep -- people by and large prefer repr().
Youre also right about `...` being less visible than other pairs of delimiters.
I think, though, that if modifying the % notation, that the requirement should be for delimiters that are not parentheses, and ones that wouldn't interfere with putting expressions between them. This would allow for eval()ing the content between the delimiters.
You could do that with ${...} if it skipped nested {...} inside, which I plan to implement as an (initially secret) extension. That should be good enough. If you try to put string literals containing { or } inside ${...} you deserve what you get. :-) Still, this wouldn't work: x = 12 y = 14 print "$x times $y equals ${x*y}".sub() You'd have to pass a special magic dict (which I *won't* supply). --Guido van Rossum (home page: http://www.python.org/~guido/)
participants (2)
-
Damien Morton
-
Guido van Rossum