Skip to content

The unicode normalization step of the python interpreter can be abused #4

@wasi-master

Description

@wasi-master

Basically the suggesion in this reddit comment

From this article:

Python always applies NFKC
normalization to characters. Therefore, two distinct characters may actually
produce the same variable name. For example:

>>> ª = 1 # FEMININE ORDINAL INDICATOR
>>> a # LATIN SMALL LETTER A (i.e., ASCII lowercase 'a')
1

I've generated a mapping of these characters taken from this url.
The mapping can be found here. But beware that some characters may not be supported in python because I haven't tested every one of them.

I suggest adding another additional flag to enable this behaviour

I would have done it myself and opened a pr but I am too busy at the moment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions