[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-31 Thread James Gerity
James Gerity added the comment: > Why was it decided to not raise a syntax error... I'm not sure if such a decision was even ever made, the error happens before normalization is applied. I.e. the parser is doing two things here: (1) validating the syntax against the grammar and (2) building

[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-30 Thread Eryk Sun
Eryk Sun added the comment: Why was it decided to not raise a syntax error when the NFKC normalization of a non-ASCII token matches a keyword? I don't see a use for cases such as `핚핗 = 1` and `핚핗 + 1`. It seems the cost in terms of confusion far outweighs any potential benefit. --

[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-30 Thread Carl Friedrich Bolz-Tereick
Carl Friedrich Bolz-Tereick added the comment: Ok, I can definitely agree with Serhiy pov: "True" is a keyword that always evaluates to the object that you get when you call bool(1). There is usually no name "True" and directly assigning to it is forbidden. But there are various other ways

[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: https://docs.python.org/3/library/constants.html#built-in-constants -- ___ Python tracker ___

[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-30 Thread Kodiologist
Kodiologist added the comment: > the builtin variable "True" Is the existence of this entity, as separate from the constant `True`, documented anywhere? constants.rst doesn't seem to acknowledge it. Indeed, is its existence a feature, or is it a CPython quirk? --

[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-29 Thread jack1142
Change by jack1142 : -- nosy: +jack1142 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: True is a keyword which is compiled to expression whose value is True, 핋핣핦핖 is an identifier which refers to the builtin variable "True" which has a value True by default. You can change the value of a builtin variable, but the value of expression True is

[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-29 Thread Carl Friedrich Bolz-Tereick
Carl Friedrich Bolz-Tereick added the comment: hah, this is "great": >>> 핋핣핦핖 = 1 >>> globals() {'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': , '__spec__': None, '__annotations__': {}, '__builtins__': , 'True': 1} The problem is that the lexer assumes that

[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-28 Thread James Gerity
Change by James Gerity : -- nosy: +SnoopJeDi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-27 Thread Kodiologist
New submission from Kodiologist : I'm not sure if this is a bug, but it certainly surprised me. Most reserved words, when Unicode-mangled, as in "핕핖핗", act like ordinary identifiers (see e.g. bpo-46520). `True`, `False`, and `None` are weird in that Unicode-mangled versions of them refer to