@@ -14,7 +14,7 @@ msgid ""
1414msgstr ""
1515"Project-Id-Version : Python 3.10\n "
1616"Report-Msgid-Bugs-To : \n "
17- "POT-Creation-Date : 2021-07-27 13:07 +0000\n "
17+ "POT-Creation-Date : 2021-08-10 13:16 +0000\n "
1818"PO-Revision-Date : 2021-06-28 01:12+0000\n "
1919"
Last-Translator :
Freesand Leo <[email protected] >, 2021\n "
2020"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -85,7 +85,7 @@ msgstr ""
8585"``True``,则所有被访问的条目都将在内存中被缓存,并会在 :meth:`~Shelf.sync` 和 :meth:`~Shelf.close` "
8686"时被写入;这可以使得对持久化字典中可变条目的修改更方便,但是如果访问的条目很多,这会消耗大量内存作为缓存,并会使得关闭操作变得非常缓慢,因为所有被访问的条目都需要写回到字典(无法确定被访问的条目中哪个是可变的,也无法确定哪个被实际修改了)。"
8787
88- #: ../../library/shelve.rst:44 ../../library/shelve.rst:140
88+ #: ../../library/shelve.rst:44 ../../library/shelve.rst:142
8989msgid ""
9090":data:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle protocol."
9191msgstr ":data:`pickle.DEFAULT_PROTOCOL` 现在会被用作默认的 pickle 协议。"
@@ -99,7 +99,7 @@ msgstr ""
9999"请不要依赖于 Shelf 的自动关闭功能;当你不再需要时应当总是显式地调用 :meth:`~Shelf.close`,或者使用 "
100100":func:`shelve.open` 作为上下文管理器::"
101101
102- #: ../../library/shelve.rst:59
102+ #: ../../library/shelve.rst:61
103103msgid ""
104104"Because the :mod:`shelve` module is backed by :mod:`pickle`, it is insecure "
105105"to load a shelf from an untrusted source. Like with pickle, loading a shelf"
@@ -108,7 +108,7 @@ msgstr ""
108108"由于 :mod:`shelve` 模块需要 :mod:`pickle` 的支持,因此从不可靠的来源载入 shelf 是不安全的。 与 pickle "
109109"一样,载入 Shelf 时可以执行任意代码。"
110110
111- #: ../../library/shelve.rst:63
111+ #: ../../library/shelve.rst:65
112112msgid ""
113113"Shelf objects support most of methods and operations supported by "
114114"dictionaries (except copying, constructors and operators ``|`` and ``|=``)."
@@ -118,11 +118,11 @@ msgstr ""
118118"Shelf 对象支持字典所支持的大多数方法和运算(除了拷贝、构造器以及 ``|`` 和 ``|=`` 运算符)。 "
119119"这样就能方便地将基于字典的脚本转换为要求持久化存储的脚本。"
120120
121- #: ../../library/shelve.rst:67
121+ #: ../../library/shelve.rst:69
122122msgid "Two additional methods are supported:"
123123msgstr "额外支持的两个方法:"
124124
125- #: ../../library/shelve.rst:71
125+ #: ../../library/shelve.rst:73
126126msgid ""
127127"Write back all entries in the cache if the shelf was opened with *writeback*"
128128" set to :const:`True`. Also empty the cache and synchronize the persistent "
@@ -132,13 +132,13 @@ msgstr ""
132132"如果 Shelf 打开时将 *writeback* 设为 :const:`True` 则写回缓存中的所有条目。 "
133133"如果可行还会清空缓存并将持久化字典同步到磁盘。 此方法会在使用 :meth:`close` 关闭 Shelf 时自动被调用。"
134134
135- #: ../../library/shelve.rst:78
135+ #: ../../library/shelve.rst:80
136136msgid ""
137137"Synchronize and close the persistent *dict* object. Operations on a closed "
138138"shelf will fail with a :exc:`ValueError`."
139139msgstr "同步并关闭持久化 *dict* 对象。 对已关闭 Shelf 的操作将失败并引发 :exc:`ValueError`。"
140140
141- #: ../../library/shelve.rst:84
141+ #: ../../library/shelve.rst:86
142142msgid ""
143143"`Persistent dictionary recipe "
144144"<https://code.activestate.com/recipes/576642/>`_ with widely supported "
@@ -147,11 +147,11 @@ msgstr ""
147147"`持久化字典方案 "
148148"<https://code.activestate.com/recipes/576642/>`_,使用了广泛支持的存储格式并具有原生字典的速度。"
149149
150- #: ../../library/shelve.rst:90
150+ #: ../../library/shelve.rst:92
151151msgid "Restrictions"
152152msgstr "限制"
153153
154- #: ../../library/shelve.rst:96
154+ #: ../../library/shelve.rst:98
155155msgid ""
156156"The choice of which database package will be used (such as :mod:`dbm.ndbm` "
157157"or :mod:`dbm.gnu`) depends on which interface is available. Therefore it is"
@@ -165,7 +165,7 @@ msgstr ""
165165" 直接打开数据库是不安全的。 如果使用了 :mod:`dbm`,数据库同样会(不幸地)受限于它 --- "
166166"这意味着存储在数据库中的(封存形式的)对象尺寸应当较小,并且在少数情况下键冲突有可能导致数据库拒绝更新。"
167167
168- #: ../../library/shelve.rst:104
168+ #: ../../library/shelve.rst:106
169169msgid ""
170170"The :mod:`shelve` module does not support *concurrent* read/write access to "
171171"shelved objects. (Multiple simultaneous read accesses are safe.) When a "
@@ -178,13 +178,13 @@ msgstr ""
178178" 对象来写入时,不应再有其他程序同时打开它来读取或写入。 Unix 文件锁定可被用来解决此问题,但这在不同 Unix "
179179"版本上会存在差异,并且需要有关所用数据库实现的细节知识。"
180180
181- #: ../../library/shelve.rst:114
181+ #: ../../library/shelve.rst:116
182182msgid ""
183183"A subclass of :class:`collections.abc.MutableMapping` which stores pickled "
184184"values in the *dict* object."
185185msgstr ":class:`collections.abc.MutableMapping` 的一个子类,它会将封存的值保存在 *dict* 对象中。"
186186
187- #: ../../library/shelve.rst:117
187+ #: ../../library/shelve.rst:119
188188msgid ""
189189"By default, pickles created with :data:`pickle.DEFAULT_PROTOCOL` are used to"
190190" serialize values. The version of the pickle protocol can be specified with"
@@ -194,7 +194,7 @@ msgstr ""
194194"在默认情况下,会使用以 :data:`pickle.DEFAULT_PROTOCOL` 创建的 pickle 来序列化值。 pickle "
195195"协议的版本可通过 *protocol* 形参来指定。 请参阅 :mod:`pickle` 文档来查看 pickle 协议的相关讨论。"
196196
197- #: ../../library/shelve.rst:122
197+ #: ../../library/shelve.rst:124
198198msgid ""
199199"If the *writeback* parameter is ``True``, the object will hold a cache of "
200200"all entries accessed and write them back to the *dict* at sync and close "
@@ -204,29 +204,29 @@ msgstr ""
204204"如果 *writeback* 形参为 ``True``,对象将为所有访问过的条目保留缓存并在同步和关闭时将它们写回到 *dict*。 "
205205"这允许对可变的条目执行自然操作,但是会消耗更多内存并让同步和关闭花费更长时间。"
206206
207- #: ../../library/shelve.rst:127
207+ #: ../../library/shelve.rst:129
208208msgid ""
209209"The *keyencoding* parameter is the encoding used to encode keys before they "
210210"are used with the underlying dict."
211211msgstr "*keyencoding* 形参是在下层字典被使用之前用于编码键的编码格式。"
212212
213- #: ../../library/shelve.rst:130
213+ #: ../../library/shelve.rst:132
214214msgid ""
215215"A :class:`Shelf` object can also be used as a context manager, in which case"
216216" it will be automatically closed when the :keyword:`with` block ends."
217217msgstr ":class:`Shelf` 对象还可以被用作上下文管理器,在这种情况下它将在 :keyword:`with` 语句块结束时自动被关闭。"
218218
219- #: ../../library/shelve.rst:133
219+ #: ../../library/shelve.rst:135
220220msgid ""
221221"Added the *keyencoding* parameter; previously, keys were always encoded in "
222222"UTF-8."
223223msgstr "添加了 *keyencoding* 形参;之前,键总是使用 UTF-8 编码。"
224224
225- #: ../../library/shelve.rst:137
225+ #: ../../library/shelve.rst:139
226226msgid "Added context manager support."
227227msgstr "添加了上下文管理器支持。"
228228
229- #: ../../library/shelve.rst:147
229+ #: ../../library/shelve.rst:149
230230msgid ""
231231"A subclass of :class:`Shelf` which exposes :meth:`first`, :meth:`!next`, "
232232":meth:`previous`, :meth:`last` and :meth:`set_location` which are available "
@@ -245,7 +245,7 @@ msgstr ""
245245":func:`bsddb.hashopen`, :func:`bsddb.btopen` 或 :func:`bsddb.rnopen` 之一来完成的。"
246246" 可选的 *protocol*, *writeback* 和 *keyencoding* 形参具有与 :class:`Shelf` 类相同的含义。"
247247
248- #: ../../library/shelve.rst:160
248+ #: ../../library/shelve.rst:162
249249msgid ""
250250"A subclass of :class:`Shelf` which accepts a *filename* instead of a dict-"
251251"like object. The underlying file will be opened using :func:`dbm.open`. By"
@@ -258,28 +258,28 @@ msgstr ""
258258" 默认情况下,文件将以读写模式打开。 可选的 *flag* 形参具有与 :func:`.open` 函数相同的含义。 可选的 *protocol* 和 "
259259"*writeback* 形参具有与 :class:`Shelf` 类相同的含义。"
260260
261- #: ../../library/shelve.rst:171
261+ #: ../../library/shelve.rst:173
262262msgid "Example"
263263msgstr "示例"
264264
265- #: ../../library/shelve.rst:173
265+ #: ../../library/shelve.rst:175
266266msgid ""
267267"To summarize the interface (``key`` is a string, ``data`` is an arbitrary "
268268"object)::"
269269msgstr "对接口的总结如下 (``key`` 为字符串,``data`` 为任意对象)::"
270270
271- #: ../../library/shelve.rst:210
271+ #: ../../library/shelve.rst:212
272272msgid "Module :mod:`dbm`"
273273msgstr "模块 :mod:`dbm`"
274274
275- #: ../../library/shelve.rst:210
275+ #: ../../library/shelve.rst:212
276276msgid "Generic interface to ``dbm``-style databases."
277277msgstr "``dbm`` 风格数据库的泛型接口。"
278278
279- #: ../../library/shelve.rst:212
279+ #: ../../library/shelve.rst:214
280280msgid "Module :mod:`pickle`"
281281msgstr "模块 :mod:`pickle`"
282282
283- #: ../../library/shelve.rst:213
283+ #: ../../library/shelve.rst:215
284284msgid "Object serialization used by :mod:`shelve`."
285285msgstr ":mod:`shelve` 所使用的对象序列化。"
0 commit comments