@@ -11,7 +11,7 @@ msgid ""
1111msgstr ""
1212"Project-Id-Version : Python 3.14\n "
1313"Report-Msgid-Bugs-To : \n "
14- "POT-Creation-Date : 2026-10-19 20:31 +0000\n "
14+ "POT-Creation-Date : 2026-10-25 18:12 +0000\n "
1515"PO-Revision-Date : 2026-05-08 17:17+0000\n "
1616"Last-Translator : Rafael Fontenelle <rffontenelle@gmail.com>, 2026\n "
1717"Language-Team : Polish (https://app.transifex.com/python-doc/teams/5390/pl/)\n "
@@ -134,7 +134,8 @@ msgstr ""
134134msgid ""
135135"Key and values are always stored as :class:`bytes`. This means that when "
136136"strings are used they are implicitly converted to the default encoding "
137- "before being stored."
137+ "before being stored. For detailed information about accepted types, see :ref:"
138+ "`dbm-key-value-types`."
138139msgstr ""
139140
140141msgid ""
@@ -160,6 +161,77 @@ msgstr ""
160161msgid ":meth:`!clear` methods are now available for all :mod:`!dbm` backends."
161162msgstr ""
162163
164+ msgid "Key and value types"
165+ msgstr ""
166+
167+ msgid ""
168+ "The accepted types for keys and values vary by backend. Keys and values are "
169+ "handled the same way, except where noted below:"
170+ msgstr ""
171+
172+ msgid "**Traditional backends:**"
173+ msgstr ""
174+
175+ msgid ""
176+ ":mod:`dbm.gnu` and :mod:`dbm.ndbm`: Accept :class:`str` and :class:`bytes` "
177+ "objects."
178+ msgstr ""
179+
180+ msgid ""
181+ ":mod:`dbm.dumb`: Accepts :class:`str` and :class:`bytes` objects; :class:"
182+ "`bytearray` is acceptable as a value, but not as a key."
183+ msgstr ""
184+
185+ msgid ""
186+ "**SQLite backend** (:mod:`dbm.sqlite3`): Accepts :class:`str`, :class:"
187+ "`bytes`, :class:`int`, :class:`float`, :class:`bool`, :class:`bytearray`, :"
188+ "class:`memoryview`, and :class:`array.array` objects."
189+ msgstr ""
190+
191+ msgid "**Storage format:**"
192+ msgstr ""
193+
194+ msgid ""
195+ "All keys and values are stored as :class:`bytes` objects in the database. "
196+ "When retrieving, you'll always get bytes back, regardless of the original "
197+ "type stored."
198+ msgstr ""
199+
200+ msgid "**Type conversion examples:**"
201+ msgstr ""
202+
203+ msgid "``db['key'] = 'string'`` stored as ``b'string'``"
204+ msgstr ""
205+
206+ msgid ""
207+ "``db['key'] = bytearray(b'data')`` stored as ``b'data'`` (:mod:`dbm.dumb` "
208+ "and :mod:`dbm.sqlite3` only)"
209+ msgstr ""
210+
211+ msgid "``db['key'] = 42`` stored as ``b'42'`` (:mod:`dbm.sqlite3` only)"
212+ msgstr ""
213+
214+ msgid "``db['key'] = 3.14`` stored as ``b'3.14'`` (:mod:`dbm.sqlite3` only)"
215+ msgstr ""
216+
217+ msgid "``db['key'] = True`` stored as ``b'1'`` (:mod:`dbm.sqlite3` only)"
218+ msgstr ""
219+
220+ msgid "``db['key'] = False`` stored as ``b'0'`` (:mod:`dbm.sqlite3` only)"
221+ msgstr ""
222+
223+ msgid ""
224+ "``db['key'] = memoryview(b'data')`` stored as ``b'data'`` (:mod:`dbm."
225+ "sqlite3` only)"
226+ msgstr ""
227+
228+ msgid ""
229+ "``db['key'] = array.array('i', [1, 2, 3])`` stored as bytes (for example, on "
230+ "little-endian: "
231+ "``b'\\ x01\\ x00\\ x00\\ x00\\ x02\\ x00\\ x00\\ x00\\ x03\\ x00\\ x00\\ x00'``) (:mod:"
232+ "`dbm.sqlite3` only)"
233+ msgstr ""
234+
163235msgid ""
164236"The following example records some hostnames and a corresponding title, and "
165237"then prints out the contents of the database::"
@@ -184,8 +256,9 @@ msgid ""
184256" # Often-used methods of the dict interface work too.\n"
185257" print(db.get('python.org', b'not present'))\n"
186258"\n"
187- " # Storing a non-string key or value will raise an exception (most\n"
188- " # likely a TypeError).\n"
259+ " # Storing a non-string key or value behavior depends on the backend:\n"
260+ " # - Traditional backends (ndbm, gnu, dumb) will raise a TypeError\n"
261+ " # - The sqlite3 backend accepts it and converts to bytes\n"
189262" db['www.yahoo.com'] = 4\n"
190263"\n"
191264"# db is automatically closed when leaving the with statement."
0 commit comments