Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize unicode identifier #2439

Open
ickc opened this issue Aug 23, 2021 · 0 comments
Open

Normalize unicode identifier #2439

ickc opened this issue Aug 23, 2021 · 0 comments
Labels
T: enhancement New feature or request

Comments

@ickc
Copy link

ickc commented Aug 23, 2021

Is your feature request related to a problem? Please describe.

Unicode normalization in unicode identifier. c.f.

The issue is that while some characters can be used as identifier, internally it is normalized. So when looked up using __all__ or getattr, it would results in an error. (See the 2nd & 3rd link for respective example.)

Describe the solution you'd like

Black should normalize all identifiers accordingly, perhaps also those inside __all__ or getattr, so that this normalization is made explicit in the code. When someone copy and paste an identifier to __all__ or getattr, it would then just works.

Describe alternatives you've considered

Fix it in Python: Issue 44981: wildcard imports should normalise names in __all__ - Python tracker.

Additional context

Edit: keys of globals() & locals() also shares the same problem:

@ickc ickc added the T: enhancement New feature or request label Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant