New Python 3.0 string formatting - really necessary?
Steven D'Aprano
steve at REMOVE-THIS-cybersource.com.au
Sat Dec 20 20:38:35 EST 2008
On Sat, 20 Dec 2008 16:20:38 -0800, r wrote:
> On Dec 20, 6:05 pm, Roy Smith <r... at panix.com> wrote:
>> I had an interesting experience with this recently. I was giving a
>> co-worker quick python into. He's an experienced programer in various
>> languages, but this was his first exposure to python.
>>
>> He got really hung up on the % syntax. By (bad) luck, he was trying to
>> print a tuple (let's call it "t"), did
>>
>> format % t
>>
>> and was surprised at the result. It set him off on a "but that's
>> stupid, blah, blah, blah" rant. I haven't absorbed the new syntax well
>> enough to figure out if people will get hung up by this with the new
>> syntax.
>
> It is stupid, more reason to fix the current problem instead creating a
> whole new one.
Instead of just whinging, how about making a suggestion to fix it? Go on,
sit down for an hour or ten and try to work out how a BINARY OPERATOR
like % (that means it can only take TWO arguments) can deal with an
arbitrary number of arguments, *without* having any special cases.
Go on. Take your time. I'll be waiting.
> One more big complaint "THE BACKSLASH PLAGUE". ever tried regexp?, or
> file paths?. All because that little backslash char is a line
> continuation character, maybe we should fix that.
This makes no sense whatsoever. How does the line continuation character
make any difference to backslashes inside a regex or a file path?
Again, instead of whinging, what's your suggestion to fix it? Another
suggestion, because your first:
> Would your life end if '\' was not a continuation char?
is just stupid. The line continuation character is *irrelevant* to the
problem of backslashes inside strings. For all the use it is, you might
as well suggest changing the name None to Null.
--
Steven
More information about the Python-list
mailing list