<div dir="ltr"><div>[Adding back python-dev]<br><br>Actually, I wasn't proposing to change repr() -- my sentiments are similar to Isaac Morland's. Only the error message for the most basic file open() call should be tweaked.<br><br></div>No solution is perfect -- but it's probably common enough for someone to create a file or folder named C:\test and being stumped by "cannot open 'C:\test'."<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 24, 2015 at 1:25 PM, Glenn Linderman <span dir="ltr"><<a href="mailto:v+python@g.nevcal.com" target="_blank">v+python@g.nevcal.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#330033"><span class="">
<div>On 2/24/2015 10:49 AM, Guido van Rossum
wrote:<br>
</div>
<blockquote type="cite">I like the \x07 solution.</blockquote>
<br></span>
The more I think about it, the more I think this is a sufficient
solution. People that use repr to get a Python-compatible string
syntax for further program use get one. People that see them in an
error message are much less likely to be fooled into thinking it is
two characters, because they are thinking of it as two characters to
start with.<br>
<br>
On the other hand, I have a directory full of "throw away"
experimental source files named x01, x02, x03, ... :)<br>
<br>
And I suppose extensive use of certain characters in repr in
intermediate or archived data could make such data grow in size.<br>
<br>
And while \t and \n are very commonly used escapes, maybe string
repr could have a special function called
.I_promise_not_to_report_issues_when_I_use_backslash_escapes_in_character_literals_and_get_confused()
which would switch back from \x07 to \t and \x0a to \n, etc. This
would be callable only from __main__ :)<br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)</div>
</div>