Lib\idlelib\colorizer.py, line 25, is:
stringprefix = r"(?i:\br|u|f|fr|rf|b|br|rb)?"
The r prefix, but only the r prefix, must be preceded by a non-word character.
On pydev thread "IDLE colorizer", MRAB noted: "The \b will apply only to the first choice. Shouldn't it be more like:
stringprefix = r"(?:\b(?i:r|u|f|fr|rf|b|br|rb))?"
I think the \b should be removed instead. Currently uf'a' gets f'a' colored, while ur'a' only gets 'a' colored. (Tim Peters pointed out the difference with a different example.) I prefer coloring the maximal legal string rather than the minimum. I think the contrast between two chars legal by themselves, but differently colored when put together, makes the bug more obvious. |