Skip to content

Commit b7f83bd

Browse files
gh-69093: Expose sqlite3.Blob as a class (GH-91550)
I noticed this was missing while writing typeshed stubs. It's useful to expose it for use in annotations and for exploration.
1 parent 6217864 commit b7f83bd

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Lib/test/test_sqlite3/test_dbapi.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,9 @@ def tearDown(self):
10551055
self.blob.close()
10561056
self.cx.close()
10571057

1058+
def test_blob_is_a_blob(self):
1059+
self.assertIsInstance(self.blob, sqlite.Blob)
1060+
10581061
def test_blob_seek_and_tell(self):
10591062
self.blob.seek(10)
10601063
self.assertEqual(self.blob.tell(), 10)

Modules/_sqlite/module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ module_exec(PyObject *module)
697697
}
698698

699699
pysqlite_state *state = pysqlite_get_state(module);
700+
ADD_TYPE(module, state->BlobType);
700701
ADD_TYPE(module, state->ConnectionType);
701702
ADD_TYPE(module, state->CursorType);
702703
ADD_TYPE(module, state->PrepareProtocolType);

0 commit comments

Comments
 (0)