Skip to content

Commit d3dd3b4

Browse files
Address review
1 parent 27eaa23 commit d3dd3b4

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

Doc/library/sqlite3.rst

+14-11
Original file line numberDiff line numberDiff line change
@@ -1347,22 +1347,27 @@ The following example illustrates the implicit and explicit approaches:
13471347
.. literalinclude:: ../includes/sqlite3/converter_point.py
13481348

13491349

1350+
.. _sqlite3-default-converters:
1351+
13501352
Default adapters and converters (deprecated)
13511353
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13521354

13531355
.. note::
13541356

13551357
The default adapters and converters are deprecated as of Python 3.12.
1356-
Instead, use the :ref:`sqlite3-adapter-converter-recipes`,
1358+
Instead, use the :ref:`sqlite3-adapter-converter-recipes`
13571359
and tailor them to your needs.
13581360

1359-
The deprecated default adapters and converters consists of:
1361+
The deprecated default adapters and converters consist of:
13601362

1361-
* Adapt :class:`datetime.date` objects to :class:`strings <str>` in ISO format.
1362-
* Adapt :class:`datetime.datetime` objects to strings ISO format.
1363-
* Convert :ref:`declared <sqlite3-converters>` "date" types to ``datetime.date``
1364-
objects.
1365-
* Convert declared "timestamp" types to ``datetime.datetime`` objects.
1363+
* An adapter for :class:`datetime.date` objects to :class:`strings <str>` in
1364+
`ISO 8601`_ format.
1365+
* An adapter for :class:`datetime.datetime` objects to strings in
1366+
ISO 8601 format.
1367+
* A converter for :ref:`declared <sqlite3-converters>` "date" types to
1368+
:class:`datetime.date` objects.
1369+
* A converter for declared "timestamp" types to
1370+
:class:`datetime.datetime` objects.
13661371
Fractional parts will be truncated to 6 digits (microsecond precision).
13671372

13681373
.. note::
@@ -1372,12 +1377,10 @@ The deprecated default adapters and converters consists of:
13721377
offsets in timestamps, either leave converters disabled, or register an
13731378
offset-aware converter with :func:`register_converter`.
13741379

1375-
.. versionchanged:: 3.12
1376-
1377-
Deprecated default adapters and converters.
1378-
13791380
.. deprecated:: 3.12
13801381

1382+
.. _ISO 8601: https://en.wikipedia.org/wiki/ISO_8601
1383+
13811384

13821385
.. _sqlite3-adapter-converter-recipes:
13831386

Doc/whatsnew/3.12.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ CPython bytecode changes
118118
Deprecated
119119
==========
120120

121-
* The default :mod:`sqlite3` adapters and converters are now deprecated.
121+
* The :mod:`sqlite3` :ref:`default adapters and converters
122+
<sqlite3-default-converters>` are now deprecated.
123+
Instead, use the :ref:`sqlite3-adapter-converter-recipes`,
124+
and tailor them to your needs.
122125
(Contributed by Erlend E. Aasland in :gh:`90016`.)
123126

124127

Lib/sqlite3/dbapi2.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ def TimestampFromTicks(ticks):
5757
def register_adapters_and_converters():
5858
from warnings import warn
5959

60-
msg = "The default {what} are deprecated as of Python 3.12"
60+
msg = ("The default {what} are deprecated as of Python 3.12; "
61+
"see the sqlite3 documentation for suggested replacement recipes")
6162

6263
def adapt_date(val):
6364
warn(msg.format(what="adapters"), DeprecationWarning, stacklevel=2)
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Deprecate default :mod:`sqlite3` adapters and converters. Patch by Erlend E.
2-
Aasland.
1+
Deprecate default :mod:`sqlite3` :ref:`default adapters and converters
2+
<sqlite3-default-converters>`. Patch by Erlend E. Aasland.

0 commit comments

Comments
 (0)