Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-99139: Improve NameError error suggestion for instances#99140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks great :)
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks really helpful, thanks a lot@pablogsal!
bedevere-bot commentedNov 5, 2022
🤖 New build scheduled with the buildbot fleet by@pablogsal for commitb1546e5 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
bedevere-bot commentedNov 6, 2022
🤖 New build scheduled with the buildbot fleet by@pablogsal for commit4925719 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| if (!locals) { | ||
| gotoerror; | ||
| } | ||
| PyObject*self=PyDict_GetItem(locals,&_Py_ID(self));/* borrowed */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do not usePyDict_GetItem. It is broken by design.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
What should we use instead for both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
PyDict_GetItemWithError andPyObject_GetAttr if limited by public API. It is suggested in the documentation. But_PyObject_LookupAttr is more convenient in the latter case.
| gotoerror; | ||
| } | ||
| if (PyObject_HasAttr(self,name)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do not usePyObject_HasAttr. It is broken by design.
millerdev commentedApr 10, 2025
I'm surprised this uses >>>classTest:...def__getattr__(self,name):...ifname=="foo":...raiseSystemExit("The end.")...defbar(self):...foo... ...Test().bar()...Theend. |
Uh oh!
There was an error while loading.Please reload this page.