[issue44981] `module has no attribute` when `__all__` includes certain unicode characters

2021-08-23 Thread Filipe Laíns
Change by Filipe Laíns : -- nosy: +FFY00 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44981] `module has no attribute` when `__all__` includes certain unicode characters

2021-08-22 Thread Eric V. Smith
Eric V. Smith added the comment: I'd be okay with changing it to a 3.11 enhancement to normalize elements of __all__, or maybe a request to change the documentation. -- ___ Python tracker

[issue44981] `module has no attribute` when `__all__` includes certain unicode characters

2021-08-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: Eric, I think you may have been too hasty to close this as "not a bug". It has tripped people up before. See #41542 which has also been closed (I also think prematurely). We normalise variable names with NFKC, so we should normalise the values in __all__

[issue44981] `module has no attribute` when `__all__` includes certain unicode characters

2021-08-22 Thread Eric V. Smith
Eric V. Smith added the comment: Python normalizes identifiers with NFKC (see PEP 3131): >>> e0 = "ϵ" >>> import unicodedata >>> e1 = unicodedata.normalize("NFKC", e0) >>> e0 == e1 False >>> unicodedata.name(e0) 'GREEK LUNATE EPSILON SYMBOL' >>> unicodedata.name(e1) 'GREEK SMALL LETTER

[issue44981] `module has no attribute` when `__all__` includes certain unicode characters

2021-08-22 Thread Kolen Cheung
New submission from Kolen Cheung : With Python 3.9.6 on macOS, In a file all_bug.py, ```py __all__ = ("ϵ",) ϵ = "ϵ" ``` Then run `from all_bug import *`, resulted in AttributeError: module 'all_bug' has no attribute 'ϵ' This happens with some other unicode characters as well, but not