Skip to content
Snippets Groups Projects
Unverified Commit c72001e5 authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by GitHub
Browse files

gh-94321: Document sqlite3.PrepareProtocol (GH-94620)


(cherry picked from commit fb6dccae)

Co-authored-by: default avatarErlend Egeberg Aasland <erlend.aasland@protonmail.com>
parent 77a01538
Branches
Tags
No related merge requests found
...@@ -1127,6 +1127,16 @@ Blob Objects ...@@ -1127,6 +1127,16 @@ Blob Objects
end). end).
PrepareProtocol Objects
-----------------------
.. class:: PrepareProtocol
The PrepareProtocol type's single purpose is to act as a :pep:`246` style
adaption protocol for objects that can :ref:`adapt themselves
<sqlite3-conform>` to :ref:`native SQLite types <sqlite3-types>`.
.. _sqlite3-exceptions: .. _sqlite3-exceptions:
Exceptions Exceptions
...@@ -1287,6 +1297,8 @@ As an application developer, it may make more sense to take direct control by ...@@ -1287,6 +1297,8 @@ As an application developer, it may make more sense to take direct control by
registering custom adapter functions. registering custom adapter functions.
.. _sqlite3-conform:
Letting your object adapt itself Letting your object adapt itself
"""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""
......
Document the :pep:`246` style protocol type
:class:`sqlite3.PrepareProtocol`.
...@@ -46,10 +46,13 @@ pysqlite_prepare_protocol_dealloc(pysqlite_PrepareProtocol *self) ...@@ -46,10 +46,13 @@ pysqlite_prepare_protocol_dealloc(pysqlite_PrepareProtocol *self)
Py_DECREF(tp); Py_DECREF(tp);
} }
PyDoc_STRVAR(doc, "PEP 246 style object adaption protocol type.");
static PyType_Slot type_slots[] = { static PyType_Slot type_slots[] = {
{Py_tp_dealloc, pysqlite_prepare_protocol_dealloc}, {Py_tp_dealloc, pysqlite_prepare_protocol_dealloc},
{Py_tp_init, pysqlite_prepare_protocol_init}, {Py_tp_init, pysqlite_prepare_protocol_init},
{Py_tp_traverse, pysqlite_prepare_protocol_traverse}, {Py_tp_traverse, pysqlite_prepare_protocol_traverse},
{Py_tp_doc, (void *)doc},
{0, NULL}, {0, NULL},
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment