Kyle Stanley <aeros...@gmail.com> added the comment:
For addressing the backwards compatibility concern, I think we should just convert it to a SyntaxWarning for cases like the above to indicate that it's not really correct syntax, but not harmful enough to justify code breakage. I think it fits the documented description of SyntaxWarning well, which is to address "dubious syntax". Lysandros Nikolaou wrote: > A possible solution would be to only emit a SyntaxError if the NAME directly > preceding a STRING token contains one of the valid string prefixes (either > one of 'f', 'r', 'u', 'b'). This would still output a nicer error message, > but would not break code like the one of the example. What do you think about > this? That would certainly help to minimize the breakage, so I'd be in favor of that over a SyntaxError for all invalid prefixes. But, I'm not certain that it's additionally harmful if an invalid string prefix proceeds a valid one. Is there any additional harm, other than from a visual perspective? ---------- nosy: +aeros _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40246> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com