On Sat, Sep 10, 2022 at 06:46:33PM +0000, c.bu...@posteo.jp wrote: > > But running this with Python 3.9.2 makes no problem. Python doesn't > give me a `SyntaxWarning` or anything else. Python doesn't give me an > error or warning. Only `flymake8` gives me this error.
Well, it's not a syntax error. Escape sequences with no meaning simply yield the escape sequence. As in, '\d' is simply '\d', in contrast with say '\u' which is invalid and if fact throws a SyntaxError. >Unlike Standard C, all unrecognized escape sequences are left in the string >unchanged, i.e., the backslash is left in the result. (This behavior is useful >when debugging: if an escape sequence is mistyped, the resulting output is >more easily recognized as broken.) It is also important to note that the >escape sequences only recognized in string literals fall into the category of >unrecognized escapes for bytes literals. from https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals -- https://mail.python.org/mailman/listinfo/python-list