GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-99139: Improve NameError error suggestion for instances by pablogsal · Pull Request #99140 · python/cpython Conversation
|
|
🤖 New build scheduled with the buildbot fleet by @pablogsal for commit b1546e5 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Ammar Askar <[email protected]>
Co-authored-by: Batuhan Taskaya <[email protected]>
Co-authored-by: Batuhan Taskaya <[email protected]>
|
🤖 New build scheduled with the buildbot fleet by @pablogsal for commit 4925719 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Kumar Aditya <[email protected]>
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| if (!locals) { | ||
| goto error; | ||
| } | ||
| PyObject* self = PyDict_GetItem(locals, &_Py_ID(self)); /* borrowed */ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do not use PyDict_GetItem. It is broken by design.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What should we use instead for both?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
PyDict_GetItemWithError and PyObject_GetAttr if limited by public API. It is suggested in the documentation. But _PyObject_LookupAttr is more convenient in the latter case.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| goto error; | ||
| } | ||
|
|
||
| if (PyObject_HasAttr(self, name)) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do not use PyObject_HasAttr. It is broken by design.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm surprised this uses >>> class Test: ... def __getattr__(self, name): ... if name == "foo": ... raise SystemExit("The end.") ... def bar(self): ... foo ... ... Test().bar() ... The end. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.