Title: Improve NameError error suggestion for instances · Issue #99139 · python/cpython · GitHub
Open Graph Title: Improve NameError error suggestion for instances · Issue #99139 · python/cpython
X Title: Improve NameError error suggestion for instances · Issue #99139 · python/cpython
Description: If we are in a method and a NameError is raised for the name X, first check if X is an attribute of the instance as self.X is likely more common than whatever closest match we find in the scope. PR: gh-99140
Open Graph Description: If we are in a method and a NameError is raised for the name X, first check if X is an attribute of the instance as self.X is likely more common than whatever closest match we find in the scope. PR...
X Description: If we are in a method and a NameError is raised for the name X, first check if X is an attribute of the instance as self.X is likely more common than whatever closest match we find in the scope. PR...
Opengraph URL: https://github.com/python/cpython/issues/99139
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve NameError error suggestion for instances","articleBody":"If we are in a method and a NameError is raised for the name X, first check if `X` is an attribute of the instance as `self.X` is likely more common than whatever closest match we find in the scope.\n\n\u003c!-- gh-pr-number: gh-99140 --\u003e\n* PR: gh-99140\n\u003c!-- /gh-pr-number --\u003e\n","author":{"url":"https://github.com/pablogsal","@type":"Person","name":"pablogsal"},"datePublished":"2022-11-05T18:34:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/99139/cpython/issues/99139"}
| 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:426e1a9d-e91b-b30d-18da-be815a47b72c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A0A:193CDB:EA93EE:133C536:696B041A |
| html-safe-nonce | 0113fba7af728d2e28d58a5ba1cbd63d4f97da07285176c8e3faf88b600942f5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTBBOjE5M0NEQjpFQTkzRUU6MTMzQzUzNjo2OTZCMDQxQSIsInZpc2l0b3JfaWQiOiI2MjkyMzg2NDU0ODkzNjkxOTMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5a7fba0a34d4baab639b34d22e4fd2aa7c8cc2fafd906e21b1282f9e7cc09d5b |
| hovercard-subject-tag | issue:1437146807 |
| 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/99139/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6b348c146ebc11b60975c703760801392cbf7da208d67e8bd4c90d5221155972/python/cpython/issues/99139 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6b348c146ebc11b60975c703760801392cbf7da208d67e8bd4c90d5221155972/python/cpython/issues/99139 |
| og:image:alt | If we are in a method and a NameError is raised for the name X, first check if X is an attribute of the instance as self.X is likely more common than whatever closest match we find in the scope. PR... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pablogsal |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width