Unrecognized escape sequences in string literals

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Fri Aug 14 19:55:59 CEST 2009

I think I've spent enough time on this discussion, so I won't be directly 
responding to any of your recent points -- it's clear that I'm not 
persuading you that there's any justification for any behaviour for 
escape sequences other than the way C++ deals with them. That's your 
prerogative, of course, but I've done enough tilting at windmills for 
this week, so I'll just make one final comment and then withdraw from an 
unproductive argument. (I will make an effort to read any final comments 
you wish to make, so feel free to reply. Just don't expect an answer to 
any questions.)

Douglas, you and I clearly have a difference of opinion on this. Neither 
of us have provided even the tiniest amount of objective, replicable, 
reliable data on the error-proneness of the C++ approach versus that of 
Python. The supposed superiority of the C++ approach is entirely 
subjective and based on personal opinion instead of quantitative facts.

I prefer languages that permit anything that isn't explicitly forbidden, 
so I'm happy that Python treats non-special escape sequences as valid, 
and your attempts to convince me that this goes against the Zen have 
entirely failed to convince me. As I've done before, I will admit that 
one consequence of this design is that it makes it hard to introduce new 
escape sequences to Python. Given that it's vanishingly rare to want to 
do so, and that wanting to add backslashes to strings is common, I think 
that's a reasonable tradeoff. Other languages may make different 
tradeoffs, and that's fine by me.


More information about the Python-list mailing list