@@ -528,10 +528,12 @@ msgid ""
528528"The :mod:`pickle` module exports three classes, :class:`Pickler`, :class:"
529529"`Unpickler` and :class:`PickleBuffer`:"
530530msgstr ""
531+ "引入模組 :mod:`pickle` 時會帶來三個類別::class:`Pickler`、:class:"
532+ "`Unpickler` 和 :class:`PickleBuffer`:"
531533
532534#: ../../library/pickle.rst:301
533535msgid "This takes a binary file for writing a pickle data stream."
534- msgstr ""
536+ msgstr "接受一個用以寫入 pickle 資料流的二進位檔案。 "
535537
536538#: ../../library/pickle.rst:303
537539msgid ""
@@ -540,6 +542,9 @@ msgid ""
540542"not specified, the default is :data:`DEFAULT_PROTOCOL`. If a negative "
541543"number is specified, :data:`HIGHEST_PROTOCOL` is selected."
542544msgstr ""
545+ "可選引數 *protocol* 接受整數,用來要求封裝器(pickler)使用指定的協定;支援"
546+ "從 0 版起到 :data:`HIGHEST_PROTOCOL` 版的協定。如未指定,則預設為 :data:"
547+ "`DEFAULT_PROTOCOL`。若指定了負數,則視為選擇 :data:`HIGHEST_PROTOCOL`。"
543548
544549#: ../../library/pickle.rst:308
545550msgid ""
@@ -548,19 +553,28 @@ msgid ""
548553"class:`io.BytesIO` instance, or any other custom object that meets this "
549554"interface."
550555msgstr ""
556+ "傳予引數 *file* 的物件必須支援可寫入單一位元組的 write() 方法。只要滿足此條"
557+ "件,傳入的物件可以是一個硬碟上二進位檔案、一個 :class:`io.BytesIO` 實例或任何"
558+ "其他滿足這個介面要求的物件。"
551559
552560#: ../../library/pickle.rst:313
553561msgid ""
554562"If *fix_imports* is true and *protocol* is less than 3, pickle will try to "
555563"map the new Python 3 names to the old module names used in Python 2, so that "
556564"the pickle data stream is readable with Python 2."
557565msgstr ""
566+ "若 *fix_imports* 設為 true 且 *protocol* 版本小於 3,本模組會嘗試將 Python 3 "
567+ "的新模組名稱轉換為 Python 2 所支援的舊名,以讓 Python 2 能正確地讀取此資料"
568+ "流。"
558569
570+ # SkyLull: 以下幾個關於 buffer_callback 的翻譯需要進一步的校對。何謂out-of-band? buffer view 應作何翻譯?
559571#: ../../library/pickle.rst:317
560572msgid ""
561573"If *buffer_callback* is ``None`` (the default), buffer views are serialized "
562574"into *file* as part of the pickle stream."
563575msgstr ""
576+ "如果 *buffer_callback* 是 ``None`` (預設值),緩衝區的視圖會作為 pickle 封裝"
577+ "串流的一部分被序列化進 *file* 中。"
564578
565579#: ../../library/pickle.rst:320
566580msgid ""
@@ -569,22 +583,30 @@ msgid ""
569583"``None``), the given buffer is :ref:`out-of-band <pickle-oob>`; otherwise "
570584"the buffer is serialized in-band, i.e. inside the pickle stream."
571585msgstr ""
586+ "如果 *buffer_callback* 不是 ``None``,則它可以被多次呼叫並傳遞一個緩衝區的視"
587+ "圖。如果回呼函數回傳一個假值(例如 ``None``),則所給的緩衝區將被視為 :ref:`"
588+ "帶外資料 <pickle-oob>`;否則,該緩衝區將被視為 pickle 串流的帶內資料被序列"
589+ "化。"
572590
573591#: ../../library/pickle.rst:325
574592msgid ""
575593"It is an error if *buffer_callback* is not ``None`` and *protocol* is "
576594"``None`` or smaller than 5."
577595msgstr ""
596+ "如果 *buffer_callback* 不是 ``None`` 且 *protocol* 是 ``None`` 或小於 5 則會"
597+ "報錯。"
578598
579599#: ../../library/pickle.rst:333
580600msgid ""
581601"Write the pickled representation of *obj* to the open file object given in "
582602"the constructor."
583- msgstr ""
603+ msgstr "將已封裝(pickled)的 *obj* 寫入已在建構式中開啟的對應檔案。 "
584604
585605#: ../../library/pickle.rst:338
586606msgid "Do nothing by default. This exists so a subclass can override it."
587607msgstr ""
608+ "預設不進行任何動作。這是一種抽象方法,用於讓後續繼承這個類別的物件可以覆寫本"
609+ "方法函數。"
588610
589611#: ../../library/pickle.rst:340
590612msgid ""
@@ -594,6 +616,10 @@ msgid ""
594616"defined by :meth:`Unpickler.persistent_load`. Note that the value returned "
595617"by :meth:`persistent_id` cannot itself have a persistent ID."
596618msgstr ""
619+ "如果 :meth:`persistent_id` 回傳 ``None``,則 *obj* 會照一般的方式進行封裝"
620+ "(pickling)。若回傳其他值,則 :class:`Pickler` 會將該值作為 *obj* 的永久識別"
621+ "碼回傳。此永久識別碼的意義應由 :meth:`Unpickler.persistent_load` 定義。請注"
622+ "意 :meth:`persistent_id` 回傳的值本身不能擁有自己的永久識別碼。"
597623
598624#: ../../library/pickle.rst:346 ../../library/pickle.rst:447
599625msgid "See :ref:`pickle-persistent` for details and examples of uses."
0 commit comments