Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb1e2866

Browse files
translate reference/datamodel.po (#941)
* translate reference/datamodel.po* Remove extraneous syntax escape as suggestedCo-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>* Address review- Mutable and Immutable are 可變 and 不可變 when being defined- 你 is used here and not 您- Apply Matt's review for GC: 垃圾回收如何進行完全是各個實作自己的事項,唯一擔保是仍然可存取的物件絕不會被回收。 -> 垃圾回收如何進行完全取決於各個實作,只要沒有被回收的物件仍是可達的。- Revise away "單層"- Apply review for 型別幾乎影響物件行為的所有面向* Translate missed source text update---------Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
1 parent5399187 commitb1e2866

File tree

1 file changed

+88
-21
lines changed

1 file changed

+88
-21
lines changed

‎reference/datamodel.po

Lines changed: 88 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,31 @@
22
# This file is distributed under the same license as the Python package.
33
#
44
# Translators:
5+
# Adrian Liaw <adrianliaw2000@gmail.com>, 2018
6+
# Kisaragi Hiu <mail@kisaragi-hiu.com>, 2024
57
msgid ""
68
msgstr ""
79
"Project-Id-Version:Python 3.13\n"
810
"Report-Msgid-Bugs-To:\n"
9-
"POT-Creation-Date:2024-09-23 07:52+0800\n"
10-
"PO-Revision-Date:2018-05-23 16:17+0000\n"
11-
"Last-Translator:Adrian Liaw <adrianliaw2000@gmail.com>\n"
11+
"POT-Creation-Date:2024-06-27 00:03+0000\n"
12+
"PO-Revision-Date:2024-09-24 19:03+0900\n"
13+
"Last-Translator:Kisaragi Hiu <mail@kisaragi-hiu.com>\n"
1214
"Language-Team:Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1315
"tw)\n"
1416
"Language:zh_TW\n"
1517
"MIME-Version:1.0\n"
1618
"Content-Type:text/plain; charset=UTF-8\n"
1719
"Content-Transfer-Encoding:8bit\n"
1820
"Plural-Forms:nplurals=1; plural=0;\n"
21+
"X-Generator:Lokalize 24.08.1\n"
1922

2023
#:../../reference/datamodel.rst:6
2124
msgid"Data model"
2225
msgstr"資料模型"
2326

2427
#:../../reference/datamodel.rst:12
2528
msgid"Objects, values and types"
26-
msgstr""
29+
msgstr"物件、數值和型別"
2730

2831
#:../../reference/datamodel.rst:18
2932
msgid""
@@ -32,6 +35,9 @@ msgid ""
3235
"sense, and in conformance to Von Neumann's model of a\"stored program "
3336
"computer\", code is also represented by objects.)"
3437
msgstr""
38+
":dfn:`物件` 是 Python 為資料的抽象表示方式。一個 Python 程式當中的所有資料皆"
39+
"由物件或物件之間的關係來呈現。(某種意義上,同時符合 Von Neumann 對於「儲存程"
40+
"式型電腦」(\"stored program computer\") 的模型,程式碼也是以物件呈現的。)"
3541

3642
#:../../reference/datamodel.rst:35
3743
msgid""
@@ -41,10 +47,14 @@ msgid ""
4147
"objects; the :func:`id` function returns an integer representing its "
4248
"identity."
4349
msgstr""
50+
"每個物件都有一個識別性、型別,和數值。物件的\\ *識別性*\\ 在物件建立後永遠不"
51+
"會改變;你也可以把它想成是該物件在記憶體中的位址。:keyword:`is` 運算子會比較"
52+
"兩個物件的識別性是否相同;:func:`id` 函式則會回傳代表一個該物件的識別性的整"
53+
"數。"
4454

4555
#:../../reference/datamodel.rst:42
4656
msgid"For CPython, ``id(x)`` is the memory address where ``x`` is stored."
47-
msgstr""
57+
msgstr"在 CPython 當中,``id(x)`` 就是 ``x`` 所儲存在的記憶體位址。"
4858

4959
#:../../reference/datamodel.rst:44
5060
msgid""
@@ -54,6 +64,10 @@ msgid ""
5464
"an object itself). Like its identity, an object's :dfn:`type` is also "
5565
"unchangeable. [#]_"
5666
msgstr""
67+
"一個物件的型別決定了該物件所支援的操作(例如「它有長度嗎?」),也同時定義該"
68+
"型別的物件能夠擁有的數值。:func:`type` 函式會回傳一個物件的型別(而該型別本身"
69+
"也是一個物件)。如同它的識別性,一個物件的型別 (:dfn:`type`) 也是不可變"
70+
"的。\\ [#]_"
5771

5872
#:../../reference/datamodel.rst:50
5973
msgid""
@@ -68,6 +82,13 @@ msgid ""
6882
"instance, numbers, strings and tuples are immutable, while dictionaries and "
6983
"lists are mutable."
7084
msgstr""
85+
"某些物件的\\ *數值*\\ 可被改變,這種物件稱作「可變的」(*mutable*);建立後數值"
86+
"不能變更的物件則稱作「不可變的」(*immutable*)。(不可變的容器物件中如果包含對"
87+
"於可變物件的參照,則後者的數值改變的時候前者的數值也會跟著一起改變;這種時候"
88+
"該容器仍會被當成是不可變的,因為它包含的物件集合仍然無法變更。因此可變或不可"
89+
"變嚴格說起並不等同於數值是否能被改變,它的定義有其他不明顯的細節。)一個物件"
90+
"是否為可變取決於它的型別;舉例來說,數字、字串和 tuple 是不可變的,而字典與串"
91+
"列則是可變的。"
7192

7293
#:../../reference/datamodel.rst:65
7394
msgid""
@@ -77,6 +98,9 @@ msgid ""
7798
"implementation quality how garbage collection is implemented, as long as no "
7899
"objects are collected that are still reachable."
79100
msgstr""
101+
"物件永遠不會被明示的摧毀;但當它們變得不再能夠存取的時候可能會被作為垃圾回"
102+
"收。每個實作都能延後垃圾回收或是乾脆忽略它 --- 垃圾回收如何進行完全取決於各個"
103+
"實作,只要沒有被回收的物件仍是可達的。"
80104

81105
#:../../reference/datamodel.rst:73
82106
msgid""
@@ -89,6 +113,11 @@ msgid ""
89113
"on immediate finalization of objects when they become unreachable (so you "
90114
"should always close files explicitly)."
91115
msgstr""
116+
"CPython 目前使用一種參照計數的方案,並提供可選的循環連結垃圾延遲偵測,這個方"
117+
"案會在大部分物件變得不可存取時馬上回收它們,但不保證能夠回收包含循環參照的垃"
118+
"圾。關於控制循環垃圾回收的資訊請見 :mod:`gc` 模組的說明文件。其他實作的行為不"
119+
"會相同,CPython 也有可能改變,因此請不要仰賴物件在變得不可存取時能夠馬上被最"
120+
"終化(亦即你應該總是明確關閉檔案)。"
92121

93122
#:../../reference/datamodel.rst:82
94123
msgid""
@@ -97,6 +126,9 @@ msgid ""
97126
"catching an exception with a :keyword:`try`...\\ :keyword:`except` statement "
98127
"may keep objects alive."
99128
msgstr""
129+
"請注意,使用一個實作的追蹤或除錯工具可能會讓原本能夠回收的物件被維持存活。也"
130+
"請注意,使用 :keyword:`try`...\\ :keyword:`except` 陳述式來抓捕例外也可能會讓"
131+
"物件維持存活。"
100132

101133
#:../../reference/datamodel.rst:87
102134
msgid""
@@ -109,6 +141,11 @@ msgid ""
109141
"`finally` statement and the :keyword:`with` statement provide convenient "
110142
"ways to do this."
111143
msgstr""
144+
"某些物件包含對於「外部」資源的參照,像是開啟的檔案或是視窗。基本上這些資源會"
145+
"在物件被回收時釋放,但因為垃圾回收不保證會發生,這種物件也會提供明確釋放外部"
146+
"資源的方式 --- 通常是 :meth:`!close` method。強烈建議各個程式明確關閉這種物"
147+
"件。:keyword:`try`...\\ :keyword:`finally` 陳述式與 :keyword:`with` 陳述式提"
148+
"供進行明確關閉的方便手段。"
112149

113150
#:../../reference/datamodel.rst:97
114151
msgid""
@@ -121,6 +158,12 @@ msgid ""
121158
"implied. So, if an immutable container (like a tuple) contains a reference "
122159
"to a mutable object, its value changes if that mutable object is changed."
123160
msgstr""
161+
"某些物件包含對於其他物件的參照;這種物件被叫做「容器」。容器的範例有 tuple、"
162+
"串列與字典。這些參照是容器的數值的一部分。通常當我們提到容器的數值的時候,我"
163+
"們指的是其中包含的物件的數值,而不是它們的識別性;但當我們提到容器是否可變的"
164+
"時候,我們指的是直接包含在其中的物件的識別性。因此,如果一個不可變的容器(像"
165+
"一個 tuple)包含對於可變物件的參照,該可變物件被變更時該容器的數值也會跟著變"
166+
"更。"
124167

125168
#:../../reference/datamodel.rst:106
126169
msgid""
@@ -138,6 +181,15 @@ msgid ""
138181
"newly created empty lists. (Note that ``e = f = []`` assigns the *same* "
139182
"object to both *e* and *f*.)"
140183
msgstr""
184+
"型別幾乎影響物件行為的所有面向。就連物件識別性的重要性某種程度上也受型別影"
185+
"響:對於不可變的型別,計算新數值的操作可能其實會回傳一個某個相同型別且相同數"
186+
"值的現存物件的參照;對於可變型別這則不會發生。舉例來說,在進行 ``a = 1; b = "
187+
"1`` 之後,*a* 和 *b* 可能會參照同一個物件,也可能不會,取決於所使用的實作。這"
188+
"是因為 :class:`int` 是不可變的型別,因此 ``1`` 的參照可以重複利用。這個行為取"
189+
"決於所使用的實作,因此不應該依賴它,但在進行物件識別性測試的時候還是需要注意"
190+
"有這件事情。而在進行 ``c = []; d = []`` 之後,*c* 和 *d* 則保證會參照兩個不"
191+
"同、獨特、且新建立的空白串列。(請注意,``e = f = []`` 則會將同一個物件同時指"
192+
"派給 *e* 和 *f*。)"
141193

142194
#:../../reference/datamodel.rst:124
143195
msgid"The standard type hierarchy"
@@ -163,7 +215,7 @@ msgstr ""
163215

164216
#:../../reference/datamodel.rst:150../../reference/datamodel.rst:152
165217
msgid"None"
166-
msgstr""
218+
msgstr"None"
167219

168220
#:../../reference/datamodel.rst:154
169221
msgid""
@@ -172,6 +224,9 @@ msgid ""
172224
"signify the absence of a value in many situations, e.g., it is returned from "
173225
"functions that don't explicitly return anything. Its truth value is false."
174226
msgstr""
227+
"這個型別只有一個數值。只有一個物件有這個數值。這個物件由內建名稱 ``None`` 存"
228+
"取。它用來在許多情況下代表數值不存在,例如沒有明確回傳任何東西的函式就會回傳"
229+
"這個物件。它的真值是 false。"
175230

176231
#:../../reference/datamodel.rst:161../../reference/datamodel.rst:163
177232
msgid"NotImplemented"
@@ -186,6 +241,10 @@ msgid ""
186241
"will then try the reflected operation, or some other fallback, depending on "
187242
"the operator.) It should not be evaluated in a boolean context."
188243
msgstr""
244+
"這個型別只有一個數值。只有一個物件有這個數值。這個物件由內建名稱 :data:"
245+
"`NotImplemented` 存取。數字方法和 rich comparison 方法應該在沒有為所提供的運"
246+
"算元實作該操作的時候回傳這個數值。(直譯器接下來則會依運算子嘗試反轉的操作或"
247+
"是其他的後備方案。)它不應該在預期布林值的情境中被計算。"
189248

190249
#:../../reference/datamodel.rst:172
191250
msgid"See :ref:`implementing-the-arithmetic-operations` for more details."
@@ -197,17 +256,22 @@ msgid ""
197256
"it currently evaluates as true, it will emit a :exc:`DeprecationWarning`. It "
198257
"will raise a :exc:`TypeError` in a future version of Python."
199258
msgstr""
259+
"在預期布林值的情境中計算 :data:`NotImplemented` 的行為已棄用。雖然目前它會計"
260+
"算為 true,它也會同時發出 :exc:`DeprecationWarning`。從某個未來 Python 版本開"
261+
"始這將會引發 :exc:`TypeError`。"
200262

201263
#:../../reference/datamodel.rst:183../../reference/datamodel.rst:184
202264
msgid"Ellipsis"
203-
msgstr""
265+
msgstr"Ellipsis"
204266

205267
#:../../reference/datamodel.rst:188
206268
msgid""
207269
"This type has a single value. There is a single object with this value. "
208270
"This object is accessed through the literal ``...`` or the built-in name "
209271
"``Ellipsis``. Its truth value is true."
210272
msgstr""
273+
"這個型別只有一個數值。只有一個物件有這個數值。這個物件由文本 ``...`` 或內建名"
274+
"稱 ``Ellipsis`` 存取。它的真值是 true。"
211275

212276
#:../../reference/datamodel.rst:194
213277
msgid":class:`numbers.Number`"
@@ -406,7 +470,7 @@ msgstr ""
406470

407471
#:../../reference/datamodel.rst:362
408472
msgid"Tuples"
409-
msgstr""
473+
msgstr"Tuple(元組)"
410474

411475
#:../../reference/datamodel.rst:368
412476
msgid""
@@ -420,7 +484,7 @@ msgstr ""
420484

421485
#:../../reference/datamodel.rst:375
422486
msgid"Bytes"
423-
msgstr""
487+
msgstr"位元組"
424488

425489
#:../../reference/datamodel.rst:378
426490
msgid""
@@ -433,7 +497,7 @@ msgstr ""
433497

434498
#:../../reference/datamodel.rst:386
435499
msgid"Mutable sequences"
436-
msgstr""
500+
msgstr"可變序列"
437501

438502
#:../../reference/datamodel.rst:395
439503
msgid""
@@ -465,7 +529,7 @@ msgstr ""
465529

466530
#:../../reference/datamodel.rst:415
467531
msgid"Byte Arrays"
468-
msgstr""
532+
msgstr"位元組陣列"
469533

470534
#:../../reference/datamodel.rst:418
471535
msgid""
@@ -477,7 +541,7 @@ msgstr ""
477541

478542
#:../../reference/datamodel.rst:425
479543
msgid"Set types"
480-
msgstr""
544+
msgstr"Set(集合)型別"
481545

482546
#:../../reference/datamodel.rst:431
483547
msgid""
@@ -503,7 +567,7 @@ msgstr ""
503567

504568
#:../../reference/datamodel.rst:446
505569
msgid"Sets"
506-
msgstr""
570+
msgstr"Set(集合)"
507571

508572
#:../../reference/datamodel.rst:449
509573
msgid""
@@ -514,7 +578,7 @@ msgstr ""
514578

515579
#:../../reference/datamodel.rst:454
516580
msgid"Frozen sets"
517-
msgstr""
581+
msgstr"Frozen set(凍結集合)"
518582

519583
#:../../reference/datamodel.rst:457
520584
msgid""
@@ -525,7 +589,7 @@ msgstr ""
525589

526590
#:../../reference/datamodel.rst:464
527591
msgid"Mappings"
528-
msgstr""
592+
msgstr"對映"
529593

530594
#:../../reference/datamodel.rst:471
531595
msgid""
@@ -585,7 +649,7 @@ msgstr ""
585649

586650
#:../../reference/datamodel.rst:517
587651
msgid"Callable types"
588-
msgstr""
652+
msgstr"可呼叫型別"
589653

590654
#:../../reference/datamodel.rst:525
591655
msgid""
@@ -829,7 +893,7 @@ msgstr ""
829893

830894
#:../../reference/datamodel.rst:741
831895
msgid"Generator functions"
832-
msgstr""
896+
msgstr"Generator(產生器)函式"
833897

834898
#:../../reference/datamodel.rst:747
835899
msgid""
@@ -846,7 +910,7 @@ msgstr ""
846910

847911
#:../../reference/datamodel.rst:759
848912
msgid"Coroutine functions"
849-
msgstr""
913+
msgstr"Coroutine(協程)函式"
850914

851915
#:../../reference/datamodel.rst:764
852916
msgid""
@@ -883,7 +947,7 @@ msgstr ""
883947

884948
#:../../reference/datamodel.rst:797
885949
msgid"Built-in functions"
886-
msgstr""
950+
msgstr"內建函式"
887951

888952
#:../../reference/datamodel.rst:804
889953
msgid""
@@ -892,6 +956,9 @@ msgid ""
892956
"standard built-in module). The number and type of the arguments are "
893957
"determined by the C function. Special read-only attributes:"
894958
msgstr""
959+
"一個內建函式物件是一個 C 函式的 wrapper。內建函式的範例有 :func:`len` 和 :"
960+
"func:`math.sin`\\\\ :mod:`math` 是一個標準的內建模組)。內建函式的引數數量"
961+
"與其型別由其包裝的 C 函式所決定。特殊唯讀屬性:"
895962

896963
#:../../reference/datamodel.rst:809
897964
msgid""
@@ -1081,7 +1148,7 @@ msgstr ""
10811148

10821149
#:../../reference/datamodel.rst:973
10831150
msgid"Special attributes:"
1084-
msgstr""
1151+
msgstr"特殊屬性:"
10851152

10861153
#:../../reference/datamodel.rst:975
10871154
msgid":attr:`~definition.__name__`"
@@ -3638,7 +3705,7 @@ msgstr ""
36383705

36393706
#:../../reference/datamodel.rst:3136
36403707
msgid"With Statement Context Managers"
3641-
msgstr""
3708+
msgstr"With 陳述式的情境管理器"
36423709

36433710
#:../../reference/datamodel.rst:3138
36443711
msgid""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp