Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translate reference/datamodel.po #941

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 86 additions & 21 deletions reference/datamodel.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,31 @@
# This file is distributed under the same license as the Python package.
#
# Translators:
# Adrian Liaw <[email protected]>, 2018
# Kisaragi Hiu <[email protected]>, 2024
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-23 07:52+0800\n"
"PO-Revision-Date: 2018-05-23 16:17+0000\n"
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
"POT-Creation-Date: 2024-06-27 00:03+0000\n"
"PO-Revision-Date: 2024-09-24 19:03+0900\n"
"Last-Translator: Kisaragi Hiu <mail@kisaragi-hiu.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: Lokalize 24.08.1\n"

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

#: ../../reference/datamodel.rst:12
msgid "Objects, values and types"
msgstr ""
msgstr "物件、數值和型別"

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

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

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

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

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

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

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

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

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

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

#: ../../reference/datamodel.rst:106
msgid ""
Expand All @@ -138,6 +181,13 @@ msgid ""
"newly created empty lists. (Note that ``e = f = []`` assigns the *same* "
"object to both *e* and *f*.)"
msgstr ""
"型別幾乎影響物件行為的所有面向。就連物件識別性的重要性某種程度上也受型別影"
"響:對於不可變的型別,計算新數值的操作可能其實會回傳一個某個相同型別且相同數"
"值的現存物件的參照;對於可變型別這則不會發生。舉例來說,在進行 ``a = 1; b = "
"1`` 之後,``a`` 和 ``b`` 可能會參照同一個物件,也可能不會,取決於所使用的實"
"作;但在進行 ``c = []; d = []`` 之後,``c`` 和 ``d`` 則保證會參照兩個不同、獨"
"特、且新建立的空白串列。(請注意,``c = d = []`` 則會將同一個物件同時指派給 "
"``c`` 和 ``d``。)"
mattwang44 marked this conversation as resolved.
Show resolved Hide resolved

#: ../../reference/datamodel.rst:124
msgid "The standard type hierarchy"
Expand All @@ -163,7 +213,7 @@ msgstr ""

#: ../../reference/datamodel.rst:150 ../../reference/datamodel.rst:152
msgid "None"
msgstr ""
msgstr "None"

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

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

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

#: ../../reference/datamodel.rst:183 ../../reference/datamodel.rst:184
msgid "Ellipsis"
msgstr ""
msgstr "Ellipsis"

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

#: ../../reference/datamodel.rst:194
msgid ":class:`numbers.Number`"
Expand Down Expand Up @@ -406,7 +468,7 @@ msgstr ""

#: ../../reference/datamodel.rst:362
msgid "Tuples"
msgstr ""
msgstr "Tuple(元組)"

#: ../../reference/datamodel.rst:368
msgid ""
Expand All @@ -420,7 +482,7 @@ msgstr ""

#: ../../reference/datamodel.rst:375
msgid "Bytes"
msgstr ""
msgstr "位元組"

#: ../../reference/datamodel.rst:378
msgid ""
Expand All @@ -433,7 +495,7 @@ msgstr ""

#: ../../reference/datamodel.rst:386
msgid "Mutable sequences"
msgstr ""
msgstr "可變序列"

#: ../../reference/datamodel.rst:395
msgid ""
Expand Down Expand Up @@ -465,7 +527,7 @@ msgstr ""

#: ../../reference/datamodel.rst:415
msgid "Byte Arrays"
msgstr ""
msgstr "位元組陣列"

#: ../../reference/datamodel.rst:418
msgid ""
Expand All @@ -477,7 +539,7 @@ msgstr ""

#: ../../reference/datamodel.rst:425
msgid "Set types"
msgstr ""
msgstr "Set(集合)型別"

#: ../../reference/datamodel.rst:431
msgid ""
Expand All @@ -503,7 +565,7 @@ msgstr ""

#: ../../reference/datamodel.rst:446
msgid "Sets"
msgstr ""
msgstr "Set(集合)"

#: ../../reference/datamodel.rst:449
msgid ""
Expand All @@ -514,7 +576,7 @@ msgstr ""

#: ../../reference/datamodel.rst:454
msgid "Frozen sets"
msgstr ""
msgstr "Frozen set(凍結集合)"

#: ../../reference/datamodel.rst:457
msgid ""
Expand All @@ -525,7 +587,7 @@ msgstr ""

#: ../../reference/datamodel.rst:464
msgid "Mappings"
msgstr ""
msgstr "對映"

#: ../../reference/datamodel.rst:471
msgid ""
Expand Down Expand Up @@ -585,7 +647,7 @@ msgstr ""

#: ../../reference/datamodel.rst:517
msgid "Callable types"
msgstr ""
msgstr "可呼叫型別"

#: ../../reference/datamodel.rst:525
msgid ""
Expand Down Expand Up @@ -829,7 +891,7 @@ msgstr ""

#: ../../reference/datamodel.rst:741
msgid "Generator functions"
msgstr ""
msgstr "Generator(產生器)函式"

#: ../../reference/datamodel.rst:747
msgid ""
Expand All @@ -846,7 +908,7 @@ msgstr ""

#: ../../reference/datamodel.rst:759
msgid "Coroutine functions"
msgstr ""
msgstr "Coroutine(協程)函式"

#: ../../reference/datamodel.rst:764
msgid ""
Expand Down Expand Up @@ -883,7 +945,7 @@ msgstr ""

#: ../../reference/datamodel.rst:797
msgid "Built-in functions"
msgstr ""
msgstr "內建函式"

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

#: ../../reference/datamodel.rst:809
msgid ""
Expand Down Expand Up @@ -1081,7 +1146,7 @@ msgstr ""

#: ../../reference/datamodel.rst:973
msgid "Special attributes:"
msgstr ""
msgstr "特殊屬性:"

#: ../../reference/datamodel.rst:975
msgid ":attr:`~definition.__name__`"
Expand Down Expand Up @@ -3640,7 +3705,7 @@ msgstr ""

#: ../../reference/datamodel.rst:3136
msgid "With Statement Context Managers"
msgstr ""
msgstr "With 陳述式的情境管理器"

#: ../../reference/datamodel.rst:3138
msgid ""
Expand Down
Loading