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-106104: Use public weakref APIs in sqlite3 by erlend-aasland · Pull Request #106105 · python/cpython Conversation
|
| PyObject *blob = _PyWeakref_GET_REF(weakref); | ||
| if (blob == NULL) { | ||
| if (!PyWeakref_Check(weakref)) { | ||
| continue; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that blobs contain something which is not a weakref?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Py_DECREF(blob); | ||
| PyObject *blob; | ||
| if (PyWeakref_GetRef(weakref, &blob) < 0) { | ||
| PyErr_WriteUnraisable((PyObject *)self); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We should make _PyErr_WriteUnraisableMsg() public, since this one logs a message which is hard to get, it gives no context.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Not a big issue, but historically, the sqlite3 extension module has been implemented (mostly) using public API. See also: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Related: I see that |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
How is it an issue to use the internal C API? The internal C API is written for best performances thanks to inlining when you control the argument types. |
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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Well, if you don't want to use the internal C API in sqlite3, yep, the change is good. But warning: I made other sqlite3 changes in the meanwhile to use more internal APIs!?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| PyErr_WriteUnraisable((PyObject *)self); | ||
| continue; | ||
| } | ||
| if (item) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I suggest if (!item) continue; to avoid one indentation level.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Well, I'll let you reply yourself (in #88140 (comment)) 😄:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I had great hope in being able to convert some stdlib extensions to the limited C API, but then i fall into Argument Clinic and I lost faith. I mean that I found more urgent things to do. If someone is volunteer to attempt that again, I'm very supportive. Maybe we might try to define some embargo on abusing private and internal APIs in Python stdlib extensions 😁 It should be the exception, not the default. I'm not sure. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi, what's the status of this PR? About converting some stdlib C extensions to the limited C API, you can see: #85283 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I don't plan to follow this up right now. If we decide to convert |
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.
The sqlite3 module should not be built as a core module
There was an error while loading. Please reload this page.