-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Open
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Example:
>>> class A:
... attrA = 1
... attr𝔹 = 2
...
>>> getattr(A, 'attrB')
2
>>> getattr(A, 'attr𝔹')
AttributeError: type object 'A' has no attribute 'attr𝔹'. Did you mean: 'attrA'?The correct suggestion is 'attrB', not 'attrA'.
Every time Python outputs suggestion for the name, it should first check whether the name is normalized. If it is not, Python should check if the normalized name exists, and suggest the normalized version, otherwise suggest names similar to the normalized version. It may be tricky, because the normalized came can look exactly like not normalized name (for example, 'µ' ('\xb5') and 'μ' ('\u03bc')). So we need to output also the ascii() of the name in that case.
johnslavik
Metadata
Metadata
Assignees
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement