for -- else: what was the motivation?

Antoon Pardon antoon.pardon at vub.be
Sun Oct 16 07:45:36 EDT 2022



Op 16/10/2022 om 13:03 schreef Chris Angelico:
> On Sun, 16 Oct 2022 at 21:19, Antoon Pardon<antoon.pardon at vub.be>  wrote:
>
>> My idea would be to reserve different unicode blocks for the keywords
>> and the identifiers. e.g. We could reserve the mathematical alphanumeric
>> block for keywords and all other letters and numbers for identifiers.
>> Doing so would allow extenting the keywords without breaking programs
>> that already use that combination as an identifier.
> Python currently defines identifiers as follows:
> https://docs.python.org/3/reference/lexical_analysis.html#identifiers
>
> Briefly, what it means is that (aside from some backward compatibility
> special cases) an identifier contains letters, numbers, and connector
> punctuation, and must not start with a number. It's not by blocks,
> it's by types.
>
> It's way WAY too late to change what's allowed for identifiers, as you
> will potentially be breaking programs that use the current rules.

So? Python has broken backward compatibility before. The cost could
be acceptable. How many programs do you estimated use the mathematical
alphanumeric block for an identifier at this moment?

>> Python could slowly transition in this direction by first allowing the
>> current keywords to be in this block. Every new keyword would only be in
>> that unicode block. If would then be possible to write python code with
>> this convention but it wouldn't be obligatory. After some time the
>> python developers could decide to make it obligatory.
> Obligatory??? Please explain how you intend to convince the entire
> world that non-ASCII code is an acceptable requirement. Explain to me
> how you're going to go to every text editor and ensure that it
> supports easy entry of Python keywords that aren't ASCII. And please
> explain how this is even better.

Why should I do that? It seems you have already made your mind up.
That is fine. It just makes explaining not very senseful.

>> I doubt this will idea will get from the ground, but I think it would
>> allow for a smoother transition into new concepts, as it is no longer a
>> strugle searching for a keyword that will break as little programs as
>> possible.
> Yeah it won't. Good luck though.

Why would I need good luck? I expressed an idea and you didn't like it.
That won't affect my life in a meaningful way.

-- 
Antoon Pardon.


More information about the Python-list mailing list