[python-committers] Deny nonbreaking spaces in the precommit script?

Fredrik Lundh fredrik at pythonware.com
Mon Nov 8 14:10:09 CET 2010


On Mon, Nov 8, 2010 at 1:59 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Mon, Nov 8, 2010 at 10:55 PM, Michael Foord <michael at voidspace.org.uk> wrote:
>> On 08/11/2010 12:53, Nick Coghlan wrote:
>>>
>>> [snip...]
>>> Non-breaking spaces are legal in utf-8 encoded Python source files.
>>> While including them accidentally is less than ideal, it is perfectly
>>> valid to include them deliberately. Trying to design an automated
>>> check that can make a reasonable guess at intent is going to require
>>> far more effort than is needed.
>>>
>>
>> Is it valid though? Standard library rules are ascii only (as referenced by
>> Guido in this thread). If you need the characters in a string literal you
>> must escape them.
>
> Nope - those are the "few specific encoding test cases" he mentioned
> in that email. They take advantage of the utf-8 encoding of the source
> files these days.

One would have thought that "test cases" referred to test cases, not
strings in non-test code, and that the "the stdlib is already supposed
to be ASCII only" meant that the standard library is supposed to be
ASCII only, not UTF-8.

</F>


More information about the python-committers mailing list