On 8/12/2019 6:34 AM, Eric V. Smith wrote:
On 8/12/2019 2:52 AM, Greg Ewing wrote:
Eric V. Smith wrote:
I'm not in any way serious about this. I just want people to realize how many wacky combinations there would be.
It doesn't matter how many combinations there are, as long as multiple prefixes combine in the way you would expect, which they do as far as I can see.
In general I agree, although there's some cognitive overhead to which combinations are valid or not. There's no "fu" strings, for example.
But for reading code that doesn't matter, so your point stands.
Please no more combinations. The presence of both legal and illegal combinations is already a mild nightmare for processing and testing. idlelib.colorizer has the following re to detest legal combinations stringprefix = r"(?i:r|u|f|fr|rf|b|br|rb)?" and the following test strings to make sure it works "# All valid prefixes for unicode and byte strings should be colored.\n" "'x', '''x''', \"x\", \"\"\"x\"\"\"\n" "r'x', u'x', R'x', U'x', f'x', F'x'\n" "fr'x', Fr'x', fR'x', FR'x', rf'x', rF'x', Rf'x', RF'x'\n" "b'x',B'x', br'x',Br'x',bR'x',BR'x', rb'x', rB'x',Rb'x',RB'x'\n" "# Invalid combinations of legal characters should be half colored.\n" "ur'x', ru'x', uf'x', fu'x', UR'x', ufr'x', rfu'x', xf'x', fx'x'\n" Or, if another prefix is added, please add an expanded guaranteed-correct regex to the stdlib somewhere. -- Terry Jan Reedy