Skip to content

Commit

Permalink
gh-69093: Expose sqlite3.Blob as a class (GH-91550)
Browse files Browse the repository at this point in the history
I noticed this was missing while writing typeshed stubs. It's
useful to expose it for use in annotations and for exploration.
  • Loading branch information
JelleZijlstra authored Apr 15, 2022
1 parent 6217864 commit b7f83bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
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 comments on commit b7f83bd

Please sign in to comment.