@@ -528,10 +528,12 @@ msgid ""
528
528
"The :mod:`pickle` module exports three classes, :class:`Pickler`, :class:"
529
529
"`Unpickler` and :class:`PickleBuffer`:"
530
530
msgstr ""
531
+ "引入模組 :mod:`pickle` 時會帶來三個類別::class:`Pickler`、:class:"
532
+ "`Unpickler` 和 :class:`PickleBuffer`:"
531
533
532
534
#: ../../library/pickle.rst:301
533
535
msgid "This takes a binary file for writing a pickle data stream."
534
- msgstr ""
536
+ msgstr "接受一個用以寫入 pickle 資料流的二進位檔案。 "
535
537
536
538
#: ../../library/pickle.rst:303
537
539
msgid ""
@@ -540,6 +542,9 @@ msgid ""
540
542
"not specified, the default is :data:`DEFAULT_PROTOCOL`. If a negative "
541
543
"number is specified, :data:`HIGHEST_PROTOCOL` is selected."
542
544
msgstr ""
545
+ "可選引數 *protocol* 接受整數,用來要求封裝器(pickler)使用指定的協定;支援"
546
+ "從 0 版起到 :data:`HIGHEST_PROTOCOL` 版的協定。如未指定,則預設為 :data:"
547
+ "`DEFAULT_PROTOCOL`。若指定了負數,則視為選擇 :data:`HIGHEST_PROTOCOL`。"
543
548
544
549
#: ../../library/pickle.rst:308
545
550
msgid ""
@@ -548,19 +553,28 @@ msgid ""
548
553
"class:`io.BytesIO` instance, or any other custom object that meets this "
549
554
"interface."
550
555
msgstr ""
556
+ "傳予引數 *file* 的物件必須支援可寫入單一位元組的 write() 方法。只要滿足此條"
557
+ "件,傳入的物件可以是一個硬碟上二進位檔案、一個 :class:`io.BytesIO` 實例或任何"
558
+ "其他滿足這個介面要求的物件。"
551
559
552
560
#: ../../library/pickle.rst:313
553
561
msgid ""
554
562
"If *fix_imports* is true and *protocol* is less than 3, pickle will try to "
555
563
"map the new Python 3 names to the old module names used in Python 2, so that "
556
564
"the pickle data stream is readable with Python 2."
557
565
msgstr ""
566
+ "若 *fix_imports* 設為 true 且 *protocol* 版本小於 3,本模組會嘗試將 Python 3 "
567
+ "的新模組名稱轉換為 Python 2 所支援的舊名,以讓 Python 2 能正確地讀取此資料"
568
+ "流。"
558
569
570
+ # SkyLull: 以下幾個關於 buffer_callback 的翻譯需要進一步的校對。何謂out-of-band? buffer view 應作何翻譯?
559
571
#: ../../library/pickle.rst:317
560
572
msgid ""
561
573
"If *buffer_callback* is ``None`` (the default), buffer views are serialized "
562
574
"into *file* as part of the pickle stream."
563
575
msgstr ""
576
+ "如果 *buffer_callback* 是 ``None`` (預設值),緩衝區的視圖會作為 pickle 封裝"
577
+ "串流的一部分被序列化進 *file* 中。"
564
578
565
579
#: ../../library/pickle.rst:320
566
580
msgid ""
@@ -569,22 +583,30 @@ msgid ""
569
583
"``None``), the given buffer is :ref:`out-of-band <pickle-oob>`; otherwise "
570
584
"the buffer is serialized in-band, i.e. inside the pickle stream."
571
585
msgstr ""
586
+ "如果 *buffer_callback* 不是 ``None``,則它可以被多次呼叫並傳遞一個緩衝區的視"
587
+ "圖。如果回呼函數回傳一個假值(例如 ``None``),則所給的緩衝區將被視為 :ref:`"
588
+ "帶外資料 <pickle-oob>`;否則,該緩衝區將被視為 pickle 串流的帶內資料被序列"
589
+ "化。"
572
590
573
591
#: ../../library/pickle.rst:325
574
592
msgid ""
575
593
"It is an error if *buffer_callback* is not ``None`` and *protocol* is "
576
594
"``None`` or smaller than 5."
577
595
msgstr ""
596
+ "如果 *buffer_callback* 不是 ``None`` 且 *protocol* 是 ``None`` 或小於 5 則會"
597
+ "報錯。"
578
598
579
599
#: ../../library/pickle.rst:333
580
600
msgid ""
581
601
"Write the pickled representation of *obj* to the open file object given in "
582
602
"the constructor."
583
- msgstr ""
603
+ msgstr "將已封裝(pickled)的 *obj* 寫入已在建構式中開啟的對應檔案。 "
584
604
585
605
#: ../../library/pickle.rst:338
586
606
msgid "Do nothing by default. This exists so a subclass can override it."
587
607
msgstr ""
608
+ "預設不進行任何動作。這是一種抽象方法,用於讓後續繼承這個類別的物件可以覆寫本"
609
+ "方法函數。"
588
610
589
611
#: ../../library/pickle.rst:340
590
612
msgid ""
@@ -594,6 +616,10 @@ msgid ""
594
616
"defined by :meth:`Unpickler.persistent_load`. Note that the value returned "
595
617
"by :meth:`persistent_id` cannot itself have a persistent ID."
596
618
msgstr ""
619
+ "如果 :meth:`persistent_id` 回傳 ``None``,則 *obj* 會照一般的方式進行封裝"
620
+ "(pickling)。若回傳其他值,則 :class:`Pickler` 會將該值作為 *obj* 的永久識別"
621
+ "碼回傳。此永久識別碼的意義應由 :meth:`Unpickler.persistent_load` 定義。請注"
622
+ "意 :meth:`persistent_id` 回傳的值本身不能擁有自己的永久識別碼。"
597
623
598
624
#: ../../library/pickle.rst:346 ../../library/pickle.rst:447
599
625
msgid "See :ref:`pickle-persistent` for details and examples of uses."
0 commit comments