@@ -8,7 +8,7 @@ msgstr ""
88"Project-Id-Version :Python 3.12\n "
99"Report-Msgid-Bugs-To :\n "
1010"POT-Creation-Date :2023-10-11 17:13+0000\n "
11- "PO-Revision-Date :2018-05-23 16:15+0000 \n "
11+ "PO-Revision-Date :2024-03-22 22:11+0800 \n "
1212"Last-Translator :Adrian Liaw <adrianliaw2000@gmail.com>\n "
1313"Language-Team :Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
1414"tw)\n "
@@ -17,10 +17,11 @@ msgstr ""
1717"Content-Type :text/plain; charset=UTF-8\n "
1818"Content-Transfer-Encoding :8bit\n "
1919"Plural-Forms :nplurals=1; plural=0;\n "
20+ "X-Generator :Poedit 3.4.1\n "
2021
2122#: ../../library/weakref.rst:4
2223msgid ":mod:`weakref` --- Weak references"
23- msgstr ""
24+ msgstr ":mod:`weakref` --- 弱參照 "
2425
2526#: ../../library/weakref.rst:14
2627msgid "**Source code:** :source:`Lib/weakref.py`"
@@ -30,13 +31,14 @@ msgstr "**原始碼:**\\ :source:`Lib/weakref.py`"
3031msgid ""
3132"The :mod:`weakref` module allows the Python programmer to create :dfn:`weak "
3233"references` to objects."
33- msgstr ""
34+ msgstr ":mod:`weakref` 模組允許 Python 程式設計師建立對物件的 :dfn:`弱參照`。 "
3435
3536#: ../../library/weakref.rst:24
3637msgid ""
3738"In the following, the term :dfn:`referent` means the object which is "
3839"referred to by a weak reference."
3940msgstr ""
41+ "在以下文章中,術語 :dfn:`參照目標 (referent)` 表示被弱參照所參考的物件。"
4042
4143#: ../../library/weakref.rst:27
4244msgid ""
@@ -47,13 +49,19 @@ msgid ""
4749"weak reference may return the object even if there are no strong references "
4850"to it."
4951msgstr ""
52+ "對物件的弱參照不足以使物件保持存在:當對參照目標的唯一剩下的參照是弱參照時,:"
53+ "term:`garbage collection` 可以自由地銷毀參照目標並將其記憶體重新用於其他用"
54+ "途。然而,在物件被確實銷毀之前,即使沒有對該物件的強參照 (strong reference),"
55+ "弱參照也可能會回傳該物件。"
5056
5157#: ../../library/weakref.rst:33
5258msgid ""
5359"A primary use for weak references is to implement caches or mappings holding "
5460"large objects, where it's desired that a large object not be kept alive "
5561"solely because it appears in a cache or mapping."
5662msgstr ""
63+ "弱參照的主要用途是實作保存大型物件的快取或對映,其不希望大型物件僅僅因為它出"
64+ "現在快取或對映中而保持存在。"
5765
5866#: ../../library/weakref.rst:37
5967msgid ""
@@ -70,6 +78,15 @@ msgid ""
7078"collection can reclaim the object, and its corresponding entries in weak "
7179"mappings are simply deleted."
7280msgstr ""
81+ "例如,如果你有許多大型的二進位影像物件,你可能會想要為每個物件關聯 "
82+ "(associate) 一個名稱。如果你使用 Python 字典將名稱對映到影像,或將影像對映到"
83+ "名稱,則影像物件將保持存活,僅因為它們在字典中作為值 (value) 或鍵 (key) 出"
84+ "現。:mod:`weakref` 模組提供的 :class:`WeakKeyDictionary` 和 :class:"
85+ "`WeakValueDictionary` 類別是另一種選擇,它們使用弱參照來建構對映,這些對映不"
86+ "會僅因為物件出現在對映物件中而使物件保持存活。例如,如果一個影像物件是 :"
87+ "class:`WeakValueDictionary` 中的一個值,那麼當對該影像物件最後的參照是弱對映 "
88+ "(weak mapping) 所持有的弱參照時,垃圾回收 (garbage collection) 可以回收該物"
89+ "件,且其對應的條目在弱對映中會被完全地刪除。"
7390
7491#: ../../library/weakref.rst:50
7592msgid ""