On Wed, Nov 03, 2021 at 03:03:54AM +1100, Chris Angelico wrote:
On Wed, Nov 3, 2021 at 1:06 AM Petr Viktorin <encukou@gmail.com> wrote:
Let me know if it's clear in the newest version, with this note:
Here, ``encoding: unicode_escape`` in the initial comment is an encoding declaration. The ``unicode_escape`` encoding instructs Python to treat ``\u0027`` as a single quote (which can start/end a string), ``\u002c`` as a comma (punctuator), etc.
Huh. Is that level of generality actually still needed? Can Python deprecate all but a small handful of encodings?
To be clear, are you proposing to deprecate the encodings *completely* or just as the source code encoding? Personally, I think that using obscure encodings as the source encoding is one of those "linters and code reviews should check it" issues. Besides, now that I've learned about this unicode_escape encoding, I think that's going to be *awesome* for winning obfuscated Python competitions! *wink* -- Steve