You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Is your feature request related to a problem? Please describe.
Unicode normalization in unicode identifier. c.f.
__all__
- Python trackerThe issue is that while some characters can be used as identifier, internally it is normalized. So when looked up using
__all__
orgetattr
, 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__
orgetattr
, so that this normalization is made explicit in the code. When someone copy and paste an identifier to__all__
orgetattr
, 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:The text was updated successfully, but these errors were encountered: