[code-quality] Change in unicode escape sequences

Florian Bruhin me at the-compiler.org
Tue Jun 28 06:52:20 EDT 2016


* Émanuel Barry <vgr255 at live.ca> [2016-06-27 21:08:20 -0400]:
> Hello Code Quality people,
> I'm writing to you today about a change that I'm proposing to CPython, which
> will warn on invalid Unicode (and bytes) escape sequences, starting 3.6. It
> will eventually become an error, although when is yet to be decided. See
> http://bugs.python.org/issue27364 for the patch and discussion. First
> message sums up pretty well what the end result will be (with maybe a few
> minor differences).
> 
> As Victor Stinner and Guido both suggested, it would be good to introduce
> this in the linters, to help folks who are running e.g. 3.5 (or 2.7 with
> plans to migrate). So here I am, asking the maintainers of the linters to
> introduce this, hopefully before 3.6.0 hits the shelves in December.

pylint already does:

    $ cat x.py
    print("hello \world")

    $ pylint x.py
    [...]
    W:  1, 0: Anomalous backslash in string: '\w'. String constant might
    be missing an r prefix. (anomalous-backslash-in-string)
    [...]

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/code-quality/attachments/20160628/dc8f7e27/attachment.sig>


More information about the code-quality mailing list