Message145566
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. |
|
Date |
User |
Action |
Args |
2011-10-14 22:19:57 | ezio.melotti | set | recipients:
+ ezio.melotti, terry.reedy, roger.serwy |
2011-10-14 22:19:57 | ezio.melotti | set | messageid: <1318630797.18.0.40966758015.issue13052@psf.upfronthosting.co.za> |
2011-10-14 22:19:56 | ezio.melotti | link | issue13052 messages |
2011-10-14 22:19:56 | ezio.melotti | create | |
|