Skip to content

Commit 33b4622

Browse files
committed
Updated docstrings
1 parent 38c1753 commit 33b4622

3 files changed

Lines changed: 24 additions & 45 deletions

File tree

apsw/__init__.pyi

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -232,21 +232,14 @@ def carray(object: Buffer | tuple[str, ...] | tuple[Buffer, ...], *, start: int
232232
:param flags: Default auto detect.
233233
234234
For numbers, detection is done from the buffer
235-
`format code <https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment>`__.
236-
Use :code:`memoryview(object).format` to see it..
237-
238-
.. list-table::
239-
:widths: auto
240-
:header-rows: 1
241-
242-
* - Format
243-
- Flag
244-
* - ``i``
245-
- ``SQLITE_CARRAY_INT32``
246-
* - ``l``
247-
- ``SQLITE_CARRAY_INT64``
248-
* - ``d``
249-
- ``SQLITE_CARRAY_DOUBLE``
235+
`format code <https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment>`__
236+
and itemsize. You can use ``format`` and ``itemsize`` attributes of :code:`memoryview(object)`
237+
to see what they are.
238+
239+
Format ``i``, ``l``, ``q``
240+
``SQLITE_CARRAY_INT32`` or ``SQLITE_CARRAY_INT64`` based on itemsize
241+
Format ``d``
242+
``SQLITE_CARRAY_DOUBLE``
250243
251244
You can explicitly provide the type such as :code:`apsw.SQLITE_CARRAY_INT32`. If
252245
it is incorrect then the values will be nonsense.

src/apsw.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -312,21 +312,14 @@ static int allow_missing_dict_bindings = 0;
312312
:param flags: Default auto detect.
313313
314314
For numbers, detection is done from the buffer
315-
`format code <https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment>`__.
316-
Use :code:`memoryview(object).format` to see it..
317-
318-
.. list-table::
319-
:widths: auto
320-
:header-rows: 1
321-
322-
* - Format
323-
- Flag
324-
* - ``i``
325-
- ``SQLITE_CARRAY_INT32``
326-
* - ``l``
327-
- ``SQLITE_CARRAY_INT64``
328-
* - ``d``
329-
- ``SQLITE_CARRAY_DOUBLE``
315+
`format code <https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment>`__
316+
and itemsize. You can use ``format`` and ``itemsize`` attributes of :code:`memoryview(object)`
317+
to see what they are.
318+
319+
Format ``i``, ``l``, ``q``
320+
``SQLITE_CARRAY_INT32`` or ``SQLITE_CARRAY_INT64`` based on itemsize
321+
Format ``d``
322+
``SQLITE_CARRAY_DOUBLE``
330323
331324
You can explicitly provide the type such as :code:`apsw.SQLITE_CARRAY_INT32`. If
332325
it is incorrect then the values will be nonsense.

src/apsw.docstrings

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,14 @@
5757
":param flags: Default auto detect.\n" \
5858
"\n" \
5959
" For numbers, detection is done from the buffer\n" \
60-
" `format code <https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment>`__.\n" \
61-
" Use :code:`memoryview(object).format` to see it..\n" \
62-
"\n" \
63-
" .. list-table::\n" \
64-
" :widths: auto\n" \
65-
" :header-rows: 1\n" \
66-
"\n" \
67-
" * - Format\n" \
68-
" - Flag\n" \
69-
" * - ``i``\n" \
70-
" - ``SQLITE_CARRAY_INT32``\n" \
71-
" * - ``l``\n" \
72-
" - ``SQLITE_CARRAY_INT64``\n" \
73-
" * - ``d``\n" \
74-
" - ``SQLITE_CARRAY_DOUBLE``\n" \
60+
" `format code <https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment>`__\n" \
61+
" and itemsize. You can use ``format`` and ``itemsize`` attributes of :code:`memoryview(object)`\n" \
62+
" to see what they are.\n" \
63+
"\n" \
64+
" Format ``i``, ``l``, ``q``\n" \
65+
" ``SQLITE_CARRAY_INT32`` or ``SQLITE_CARRAY_INT64`` based on itemsize\n" \
66+
" Format ``d``\n" \
67+
" ``SQLITE_CARRAY_DOUBLE``\n" \
7568
"\n" \
7669
" You can explicitly provide the type such as :code:`apsw.SQLITE_CARRAY_INT32`. If\n" \
7770
" it is incorrect then the values will be nonsense.\n" \

0 commit comments

Comments
 (0)