@@ -130,7 +130,10 @@ Key and Value Types
130130The accepted types for keys and values vary by backend. Keys and values are
131131handled identically:
132132
133- * **Traditional backends **: :mod: `dbm.gnu `, :mod: `dbm.ndbm `, and :mod: `dbm.dumb ` accept :class: `str ` and :class: `bytes ` objects.
133+ * **Traditional backends **:
134+
135+ * :mod: `dbm.gnu ` and :mod: `dbm.ndbm `: Accept :class: `str ` and :class: `bytes ` objects.
136+ * :mod: `dbm.dumb `: Accepts :class: `str ` and :class: `bytes ` objects; :class: `bytearray ` is acceptable as a value, but not as a key.
134137* **SQLite backend ** (:mod: `dbm.sqlite3 `): Accepts :class: `str `, :class: `bytes `,
135138 :class: `int `, :class: `float `, :class: `bool `, :class: `bytearray `,
136139 :class: `memoryview `, and :class: `array.array ` objects.
@@ -151,8 +154,6 @@ type stored.
151154* ``db['key'] = False `` stored as ``b'0' `` (:mod: `dbm.sqlite3 ` only)
152155* ``db['key'] = memoryview(b'data') `` stored as ``b'data' `` (:mod: `dbm.sqlite3 ` only)
153156* ``db['key'] = array.array('i', [1, 2, 3]) `` stored as bytes (e.g. on little-endian: ``b'\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00' ``) (:mod: `dbm.sqlite3 ` only)
154- * ``db['key'] = None `` fails on all backends
155- * ``db['key'] = [1, 2, 3] `` fails on all backends
156157
157158
158159The following example records some hostnames and a corresponding title, and
0 commit comments