@@ -8,7 +8,7 @@ msgstr ""
8
8
"Project-Id-Version :Python 3.12\n "
9
9
"Report-Msgid-Bugs-To :\n "
10
10
"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 "
12
12
"Last-Translator :Adrian Liaw <adrianliaw2000@gmail.com>\n "
13
13
"Language-Team :Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
14
"tw)\n "
@@ -17,10 +17,11 @@ msgstr ""
17
17
"Content-Type :text/plain; charset=UTF-8\n "
18
18
"Content-Transfer-Encoding :8bit\n "
19
19
"Plural-Forms :nplurals=1; plural=0;\n "
20
+ "X-Generator :Poedit 3.4.1\n "
20
21
21
22
#: ../../library/weakref.rst:4
22
23
msgid ":mod:`weakref` --- Weak references"
23
- msgstr ""
24
+ msgstr ":mod:`weakref` --- 弱參照 "
24
25
25
26
#: ../../library/weakref.rst:14
26
27
msgid "**Source code:** :source:`Lib/weakref.py`"
@@ -30,13 +31,14 @@ msgstr "**原始碼:**\\ :source:`Lib/weakref.py`"
30
31
msgid ""
31
32
"The :mod:`weakref` module allows the Python programmer to create :dfn:`weak "
32
33
"references` to objects."
33
- msgstr ""
34
+ msgstr ":mod:`weakref` 模組允許 Python 程式設計師建立對物件的 :dfn:`弱參照`。 "
34
35
35
36
#: ../../library/weakref.rst:24
36
37
msgid ""
37
38
"In the following, the term :dfn:`referent` means the object which is "
38
39
"referred to by a weak reference."
39
40
msgstr ""
41
+ "在以下文章中,術語 :dfn:`參照目標 (referent)` 表示被弱參照所參考的物件。"
40
42
41
43
#: ../../library/weakref.rst:27
42
44
msgid ""
@@ -47,13 +49,19 @@ msgid ""
47
49
"weak reference may return the object even if there are no strong references "
48
50
"to it."
49
51
msgstr ""
52
+ "對物件的弱參照不足以使物件保持存在:當對參照目標的唯一剩下的參照是弱參照時,:"
53
+ "term:`garbage collection` 可以自由地銷毀參照目標並將其記憶體重新用於其他用"
54
+ "途。然而,在物件被確實銷毀之前,即使沒有對該物件的強參照 (strong reference),"
55
+ "弱參照也可能會回傳該物件。"
50
56
51
57
#: ../../library/weakref.rst:33
52
58
msgid ""
53
59
"A primary use for weak references is to implement caches or mappings holding "
54
60
"large objects, where it's desired that a large object not be kept alive "
55
61
"solely because it appears in a cache or mapping."
56
62
msgstr ""
63
+ "弱參照的主要用途是實作保存大型物件的快取或對映,其不希望大型物件僅僅因為它出"
64
+ "現在快取或對映中而保持存在。"
57
65
58
66
#: ../../library/weakref.rst:37
59
67
msgid ""
@@ -70,6 +78,15 @@ msgid ""
70
78
"collection can reclaim the object, and its corresponding entries in weak "
71
79
"mappings are simply deleted."
72
80
msgstr ""
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
+ "件,且其對應的條目在弱對映中會被完全地刪除。"
73
90
74
91
#: ../../library/weakref.rst:50
75
92
msgid ""