FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-docs-zh-tw/library/copy.po at library/string · python/python-docs-zh-tw · GitHub
python
python-docs-zh-tw
Repository navigation
Code
Issues
33
(33)
Pull requests
11
(11)
Discussions
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-docs-zh-tw
/
library
/
copy.po
Copy path
More file actions
More file actions
Latest commit
History
History
History
199 lines (173 loc) · 8.12 KB
Breadcrumbs
python-docs-zh-tw
/
library
/
copy.po
Copy path
File metadata and controls
199 lines (173 loc) · 8.12 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#
Copyright (C) 2001-2022, Python Software Foundation
#
This file is distributed under the same license as the Python package.
#
#
Translators:
#
Adrian Liaw <adrianliaw2000@gmail.com>, 2018
#
Matt Wang <mattwang44@gmail.com>, 2022
msgid ""
msgstr ""
"
Project-Id-Version
:
Python 3.12\n
"
"
Report-Msgid-Bugs-To
:
\n
"
"
POT-Creation-Date
:
2023-05-09 00:15+0000\n
"
"
PO-Revision-Date
:
2022-01-20 18:49+0800\n
"
"
Last-Translator
:
Matt Wang <mattwang44@gmail.com>\n
"
"
Language-Team
:
Chinese - TAIWAN (https://github.com/python/python-docs-zh-
"
"
tw)\n
"
"
Language
:
zh_TW\n
"
"
MIME-Version
:
1.0\n
"
"
Content-Type
:
text/plain; charset=UTF-8\n
"
"
Content-Transfer-Encoding
:
8bit\n
"
"
Plural-Forms
:
nplurals=1; plural=0;\n
"
"
X-Generator
:
Poedit 3.0.1\n
"
#:
../../library/copy.rst:2
msgid
":mod:`copy` --- Shallow and deep copy operations"
msgstr
":mod:`copy` --- 淺層 (shallow) 和深層 (deep) 複製操作"
#:
../../library/copy.rst:7
msgid
"**Source code:** :source:`Lib/copy.py`"
msgstr
"**原始碼:**
\\
:source:`Lib/copy.py`"
#:
../../library/copy.rst:11
msgid
""
"Assignment statements in Python do not copy objects, they create bindings "
"between a target and an object. For collections that are mutable or contain "
"mutable items, a copy is sometimes needed so one can change one copy without "
"changing the other. This module provides generic shallow and deep copy "
"operations (explained below)."
msgstr
""
"Python 的賦值陳述式不複製物件,而是建立目標和物件的繫結 (binding) 關係。對於"
"可變 (mutable) 或包含可變項目 (mutable item) 的集合,有時會需要一份副本來改變"
"特定副本,而不必改變其他副本。本模組提供了通用的淺層複製和深層複製操作(如下"
"所述)。"
#:
../../library/copy.rst:18
msgid
"Interface summary:"
msgstr
"介面摘要:"
#:
../../library/copy.rst:22
msgid
"Return a shallow copy of *x*."
msgstr
"回傳 *x* 的淺層複製。"
#:
../../library/copy.rst:27
msgid
"Return a deep copy of *x*."
msgstr
"回傳 *x* 的深層複製。"
#:
../../library/copy.rst:32
msgid
"Raised for module specific errors."
msgstr
"引發針對特定模組的錯誤。"
#:
../../library/copy.rst:36
msgid
""
"The difference between shallow and deep copying is only relevant for "
"compound objects (objects that contain other objects, like lists or class "
"instances):"
msgstr
""
"淺層與深層複製的區別僅與複合物件(即包含 list 或類別的實例等其他物件的物件)"
"相關:"
#:
../../library/copy.rst:39
msgid
""
"A *shallow copy* constructs a new compound object and then (to the extent "
"possible) inserts *references* into it to the objects found in the original."
msgstr
""
"*淺層複製*
\\
建構一個新的複合物件,然後(在儘可能的範圍內)將原始物件中找到的"
"物件的
\\
*參照*
\\
插入其中。"
#:
../../library/copy.rst:42
msgid
""
"A *deep copy* constructs a new compound object and then, recursively, "
"inserts *copies* into it of the objects found in the original."
msgstr
""
"*深層複製*
\\
建構一個新的複合物件,然後遞迴地將在原始物件裡找到的物件的
\\
*副"
"本*
\\
插入其中。"
#:
../../library/copy.rst:45
msgid
""
"Two problems often exist with deep copy operations that don't exist with "
"shallow copy operations:"
msgstr
"深層複製操作通常存在兩個問題,而淺層複製操作並不存在這些問題:"
#:
../../library/copy.rst:48
msgid
""
"Recursive objects (compound objects that, directly or indirectly, contain a "
"reference to themselves) may cause a recursive loop."
msgstr
"遞迴物件(直接或間接包含對自身參照的複合物件)可能會導致遞迴迴圈。"
#:
../../library/copy.rst:51
msgid
""
"Because deep copy copies everything it may copy too much, such as data which "
"is intended to be shared between copies."
msgstr
""
"由於深層複製會複製所有內容,因此可能會有過多複製(例如應該在副本之間共享的資"
"料)。"
#:
../../library/copy.rst:54
msgid
"The :func:`deepcopy` function avoids these problems by:"
msgstr
":func:`deepcopy` 函式用以下方式避免了這些問題:"
#:
../../library/copy.rst:56
msgid
""
"keeping a ``memo`` dictionary of objects already copied during the current "
"copying pass; and"
msgstr
"保留在當前複製過程中已複製的物件的 ``memo`` 字典;以及"
#:
../../library/copy.rst:59
msgid
""
"letting user-defined classes override the copying operation or the set of "
"components copied."
msgstr
"允許使用者定義的類別複寫 (override) 複製操作或複製的元件集合。"
#:
../../library/copy.rst:62
msgid
""
"This module does not copy types like module, method, stack trace, stack "
"frame, file, socket, window, or any similar types. It does
\"
copy
\"
"
"functions and classes (shallow and deeply), by returning the original object "
"unchanged; this is compatible with the way these are treated by the :mod:"
"`pickle` module."
msgstr
""
"該模組不複製模組、方法、堆疊追蹤(stack trace)、堆疊框(stack frame)、檔"
"案、socket、視窗、陣列以及任何類似的型別。它透過不變更原始物件並將其回傳來"
"(淺層或深層地)
\"
複製
\"
函式和類別;這與 :mod:`pickle` 模組處理這類問題的方式"
"是相似的。"
#:
../../library/copy.rst:67
msgid
""
"Shallow copies of dictionaries can be made using :meth:`dict.copy`, and of "
"lists by assigning a slice of the entire list, for example, ``copied_list = "
"original_list[:]``."
msgstr
""
"字典的淺層複製可以使用 :meth:`dict.copy`
\\
,而 list 的淺層複製可以透過賦值整"
"個 list 的切片 (slice) 完成,例如,``copied_list = original_list[:]``
\\
。"
#:
../../library/copy.rst:73
msgid
""
"Classes can use the same interfaces to control copying that they use to "
"control pickling. See the description of module :mod:`pickle` for "
"information on these methods. In fact, the :mod:`copy` module uses the "
"registered pickle functions from the :mod:`copyreg` module."
msgstr
""
"類別可以使用與操作 pickle 相同的介面來控制複製操作,關於這些方法的描述資訊請"
"參考 :mod:`pickle` 模組。實際上,:mod:`copy` 模組使用的正是從 :mod:`copyreg` "
"模組中註冊的 pickle 函式。"
#:
../../library/copy.rst:82
msgid
""
"In order for a class to define its own copy implementation, it can define "
"special methods :meth:`__copy__` and :meth:`__deepcopy__`. The former is "
"called to implement the shallow copy operation; no additional arguments are "
"passed. The latter is called to implement the deep copy operation; it is "
"passed one argument, the ``memo`` dictionary. If the :meth:`__deepcopy__` "
"implementation needs to make a deep copy of a component, it should call the :"
"func:`deepcopy` function with the component as first argument and the memo "
"dictionary as second argument. The memo dictionary should be treated as an "
"opaque object."
msgstr
""
"想要為一個類別定義它自己的複製操作實作,可以透過定義特殊方法 :meth:"
"`__copy__` 和 :meth:`__deepcopy__`
\\
。呼叫前者以實現淺層複製操作;不必傳入額"
"外引數。呼叫後者以實現深層複製操作;它應傳入一個引數,即 ``memo`` 字典。如"
"果 :meth:`__deepcopy__` 實現需要建立一個元件的深層複製,它應當呼叫 :func:"
"`deepcopy` 函式並以該元件作為第一個引數、以該 memo 字典作為第二個引數。memo "
"字典應當被當作不透明物件 (opaque object) 來處理。"
#:
../../library/copy.rst:95
msgid
"Module :mod:`pickle`"
msgstr
":mod:`pickle` 模組"
#:
../../library/copy.rst:95
msgid
""
"Discussion of the special methods used to support object state retrieval and "
"restoration."
msgstr
""
"支援物件之狀態檢索 (state retrieval) 和恢復 (restoration) 相關特殊方法的討"
"論。"
#:
../../library/copy.rst:71
msgid
"module"
msgstr
"module(模組)"
#:
../../library/copy.rst:71
msgid
"pickle"
msgstr
"pickle"
#:
../../library/copy.rst:78
msgid
"__copy__() (copy protocol)"
msgstr
"__copy__() (複製協定)"
#:
../../library/copy.rst:78
msgid
"__deepcopy__() (copy protocol)"
msgstr
"__deepcopy__() (複製協定)"
Back
|
FazBrowse Home
|
New Git URL