This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Kodiologist
Recipients Kodiologist
Date 2022-01-27.21:57:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1643320642.51.0.743138920796.issue46555@roundup.psfhosted.org>
In-reply-to
Content
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 those same constants initially, but can take on their own identity as variables if assigned to:

    Python 3.9.7 (default, Sep 10 2021, 14:59:43) 
    [GCC 11.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 𝕋𝕣𝕦𝕖
    True
    >>> True = 0
      File "<stdin>", line 1
        True = 0
        ^
    SyntaxError: cannot assign to True
    >>> 𝕋𝕣𝕦𝕖 = 0
    >>> True
    True
    >>> 𝕋𝕣𝕦𝕖
    0

I think that `𝕋𝕣𝕦𝕖 = 1` should probably be forbidden. The fact that `𝕋𝕣𝕦𝕖` doesn't always mean the same thing as `True` seems to break the rule in PEP 3131 that "comparison of identifiers is based on NFKC".
History
Date User Action Args
2022-01-27 21:57:22Kodiologistsetrecipients: + Kodiologist
2022-01-27 21:57:22Kodiologistsetmessageid: <1643320642.51.0.743138920796.issue46555@roundup.psfhosted.org>
2022-01-27 21:57:22Kodiologistlinkissue46555 messages
2022-01-27 21:57:22Kodiologistcreate