Ezio Melotti <ezio.melo...@gmail.com> added the comment:

Defining the desired behavior is a good place where to start.  Next it would be 
good to have tests that reflect the desired behavior, and eventually make them 
pass with a proper patch.

Currently IDLE seems to understand \n, \t, etc. in the "Replace with" field, 
but not in the "Find" field.  That means that it's possible to easily replace 
e.g. 4 spaces with a \t, but not the other way around.
This works regardless of the "Regular expression" checkbox.

When "Regular expression" is checked, backreferences like \1 also work (if used 
correctly).

I think these behaviors are fine and should be preserved.  For the non-regex 
mode, re.escape() could be used if the \n, \t, etc. still work, but I think 
that for the regex mode the right way to go is to catch regex errors.  This 
will protect against wrong backreferences and trailing \, without altering the 
meaning of the regex.

We could also support \n, \t, etc. in the "Find" box, but that's a separate 
issue.

Regarding the print(input()) and the other example, they all seem to work fine 
here with 3.2/XP.

----------
stage: needs patch -> test needed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13052>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to