mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
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.
This commit is contained in:
parent
6217864fe5
commit
b7f83bdd0e
2 changed files with 4 additions and 0 deletions
|
@ -1055,6 +1055,9 @@ class BlobTests(unittest.TestCase):
|
||||||
self.blob.close()
|
self.blob.close()
|
||||||
self.cx.close()
|
self.cx.close()
|
||||||
|
|
||||||
|
def test_blob_is_a_blob(self):
|
||||||
|
self.assertIsInstance(self.blob, sqlite.Blob)
|
||||||
|
|
||||||
def test_blob_seek_and_tell(self):
|
def test_blob_seek_and_tell(self):
|
||||||
self.blob.seek(10)
|
self.blob.seek(10)
|
||||||
self.assertEqual(self.blob.tell(), 10)
|
self.assertEqual(self.blob.tell(), 10)
|
||||||
|
|
|
@ -697,6 +697,7 @@ module_exec(PyObject *module)
|
||||||
}
|
}
|
||||||
|
|
||||||
pysqlite_state *state = pysqlite_get_state(module);
|
pysqlite_state *state = pysqlite_get_state(module);
|
||||||
|
ADD_TYPE(module, state->BlobType);
|
||||||
ADD_TYPE(module, state->ConnectionType);
|
ADD_TYPE(module, state->ConnectionType);
|
||||||
ADD_TYPE(module, state->CursorType);
|
ADD_TYPE(module, state->CursorType);
|
||||||
ADD_TYPE(module, state->PrepareProtocolType);
|
ADD_TYPE(module, state->PrepareProtocolType);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue