[Python-ideas] Allow additional separator character in variables

Mikhail V mikhailwas at gmail.com
Thu Nov 23 09:10:28 EST 2017


On Thu, Nov 23, 2017 at 4:46 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On 21 November 2017 at 21:55, Stephen J. Turnbull
> <turnbull.stephen.fw at u.tsukuba.ac.jp> wrote:
>>
>> Personally, I think that Python probably should ban non-ASCII
>> non-letter characters in identifiers and whitespace, and maybe add
>> them later in response to requests from native speakers of the
>> relevant languages.  I don't know how easy that would be to do,
>> though, since I think the rule is already that identifiers must be
>> composed only of letters, numbers, and ASCII "_".  Since Serhiy's
>> examples are valid, we'd have to rule them out explicitly, rather than
>> by reference to the Unicode database.  Yuck.


> Beyond that, I'll note that these questions were all raised in the original
> PEP: https://www.python.org/dev/peps/pep-3131/#open-issues
>
> The reference interpreter really isn't the place to experiment with
> answering them - rather, they're more a question for opt-in code analysis,
> since that makes it possible for folks to choose settings that are right
> *for them* (e.g. by defining a set of "permitted scripts" [1], specifying
> the Unicode characters that should be allowed in identifiers beyond the core
> set of "Latin" code points allowed by ASCII)

Well, then there is some bitter irony in this, so it allows pretty
much everything,
but does not allow me to beautify code with hyphens.
I can fully understand the wish to use non-latin scripts in strings or comments.
As for identifiers, IMO, apart from latin letters and underscore, the
first unicode candidate
I would add is U+2010. And probably the LAST one I would add.


Mikhail


More information about the Python-ideas mailing list