8000 gh-69093: Expose sqlite3.Blob as a class by JelleZijlstra · Pull Request #91550 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-69093: Expose sqlite3.Blob as a class #91550

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-69093: Expose sqlite3.Blob as a class
I noticed this was missing while writing typeshed stubs. It's
useful to expose it for use in annotations.
  • Loading branch information
JelleZijlstra committed Apr 15, 2022
commit 15709f9dd0a7d8e7bc5c630f7fc3fc8b2e78c0f7
3 changes: 3 additions & 0 deletions Lib/test/test_sqlite3/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,9 @@ def tearDown(self):
self.blob.close()
self.cx.close()

def test_blob_is_a_blob(self):
self.assertIsInstance(self.blob, sqlite.Blob)

def test_blob_seek_and_tell(self):
self.blob.seek(10)
self.assertEqual(self.blob.tell(), 10)
Expand Down
1 change: 1 addition & 0 deletions Modules/_sqlite/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ module_exec(PyObject *module)
}

pysqlite_state *state = pysqlite_get_state(module);
ADD_TYPE(module, state->BlobType);
ADD_TYPE(module, state->ConnectionType);
ADD_TYPE(module, state->CursorType);
ADD_TYPE(module, state->PrepareProtocolType);
Expand Down
0