Whatever happened to String Interpolation?
Tim Hammerquist
tim at vegeta.ath.cx
Sun Dec 2 02:44:16 EST 2001
Fernando Pérez <fperez528 at yahoo.com> graced us by uttering:
> Tim Hammerquist wrote:
[ snip ]
>> This slippery slope is one of many reasons many Pythonistas don't
>> want creeping featurism to infect their language.
>
> I honestly don't see it as a slippery slope. Ping's implementation
> seems to 'do the right thing' in all cases, produces no surprises and
> doesn't at all require the kind of grossness you quoted.
It doesn't require said "grossness", but it didn't do what it looked
like...at least not to these eyes. Again, that's just me. =)
> I don't see interpolated strings as being a 'slippery slope', the
> concept of special strings is *already* in the language.
Fair enough. Perhaps I spoke too soon.
> I certainly *don't* want to see Python go the perl route (and I've
> written a lot of perl, so I know exactly what it's like). But that
> doesn't mean that there aren't things where python's current syntax
> can actually end up leading to unnecessary ugliness.
This seems to be a quite prominent fear in this NG. ;)
> In fact, things like 'blah %(var)s' to me look a lot less readable
> (and line noise like, perl-like, whatever) than 'blah $var'. Or is it
> that in Python there's such a rabid fear of $ as to not even admit a
> case where something like it may be useful?
It's possible.
It's always important, though, to remember where we came from:
cout << "Enter a number: " << crlf;
cin >> i_num;
cout << "You entered " << i_num << crlf;
;)
Tim Hammerquist
--
Sometimes we can choose the path we follow.
Sometimes our choices are made for us.
And sometimes we have no choice at all.
-- Morpheus, The Sandman
More information about the Python-list
mailing list