Title: Suggestions: check that the name is normalized · Issue #143962 · python/cpython · GitHub
Open Graph Title: Suggestions: check that the name is normalized · Issue #143962 · python/cpython
X Title: Suggestions: check that the name is normalized · Issue #143962 · python/cpython
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 'at...
Open Graph 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...
X Description: Feature or enhancement Example: >>> class A: ... attrA = 1 ... attr𝔹 = 2 ... >>> getattr(A, 'attrB') 2 >>> getattr(A, 'attr𝔹') AttributeError: type object...
Opengraph URL: https://github.com/python/cpython/issues/143962
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Suggestions: check that the name is normalized","articleBody":"# Feature or enhancement\n\nExample:\n```pycon\n\u003e\u003e\u003e class A:\n... attrA = 1\n... attr𝔹 = 2\n... \n\u003e\u003e\u003e getattr(A, 'attrB')\n2\n\u003e\u003e\u003e getattr(A, 'attr𝔹')\nAttributeError: type object 'A' has no attribute 'attr𝔹'. Did you mean: 'attrA'?\n```\nThe correct suggestion is 'attrB', not 'attrA'.\n\nEvery 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.\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2026-01-17T14:12:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/143962/cpython/issues/143962"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:991e1e37-625f-286f-dacb-f772e723d255 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A216:1F1F98:A82CEB7:E080896:696E3568 |
| html-safe-nonce | c7525298a7c703f97bd10e9989b564097e635fb20dc68f96918808db06ee8643 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjE2OjFGMUY5ODpBODJDRUI3OkUwODA4OTY6Njk2RTM1NjgiLCJ2aXNpdG9yX2lkIjoiNjYzOTgwNTk5NzQyOTY5MTkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 21dba57d681bbacdfee8da956de8338e3b5b0f148a3b59c13ac28cb3e2fd6092 |
| hovercard-subject-tag | issue:3825261481 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/143962/issue_layout |
| twitter:image | https://opengraph.githubassets.com/766daf85264c263094083d76dbf25e69f05cd09cc7f1a3af43194607b62910d9/python/cpython/issues/143962 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/766daf85264c263094083d76dbf25e69f05cd09cc7f1a3af43194607b62910d9/python/cpython/issues/143962 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| hostname | github.com |
| expected-hostname | github.com |
| None | b39958d54b39d52b9fc890ff25687d2383a83e003512d4480499b2dbd046839f |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fba10be4ea34590240b2f4a625fc807362c2d5b8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width