Skip to content

Commit 1db3935

Browse files
committed
Re-clarify traditional dbm backend types and drop dumb bytearray test
1 parent 6c9765f commit 1db3935

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

Doc/library/dbm.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,10 @@ Key and Value Types
130130
The accepted types for keys and values vary by backend. Keys and values are
131131
handled identically:
132132

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`, :class:`bytes`, and :class:`bytearray` objects
133+
* **Traditional backends**: :mod:`dbm.gnu`, :mod:`dbm.ndbm`, and :mod:`dbm.dumb` accept :class:`str` and :class:`bytes` objects.
137134
* **SQLite backend** (:mod:`dbm.sqlite3`): Accepts :class:`str`, :class:`bytes`,
138135
:class:`int`, :class:`float`, :class:`bool`, :class:`bytearray`,
139-
:class:`memoryview`, and :class:`array.array` objects
136+
:class:`memoryview`, and :class:`array.array` objects.
140137

141138
**Storage Format:**
142139

Lib/test/test_dbm_dumb.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,6 @@ def test_str_write_contains(self):
130130
self._dict['\u00fc'.encode('utf-8')])
131131
self.assertEqual(f[b'1'], b'a')
132132

133-
def test_bytearray(self):
134-
with contextlib.closing(dumbdbm.open(_fname, 'n')) as f:
135-
f['key'] = bytearray(b'bytearray_value')
136-
self.assertEqual(f[b'key'], b'bytearray_value')
137-
f[bytearray(b'bytearray_key')] = b'value'
138-
self.assertEqual(f[b'bytearray_key'], b'value')
139-
140133
def test_line_endings(self):
141134
# test for bug #1172763: dumbdbm would die if the line endings
142135
# weren't what was expected.

0 commit comments

Comments
 (0)