diff --git a/library/functions.po b/library/functions.po index 34467cd6f7..adaf50effe 100644 --- a/library/functions.po +++ b/library/functions.po @@ -1,9 +1,9 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. -# # Translators: -# Andrian Liaw , 2018 +# Adrian Liaw , 2018 +# nienzu , 2018 +# Matt Wang , 2021 # Phil Lin , 2022 msgid "" msgstr "" @@ -30,8 +30,7 @@ msgid "" "The Python interpreter has a number of functions and types built into it " "that are always available. They are listed here in alphabetical order." msgstr "" -"Python 直譯器有內建數十個函式,隨時都可以使用這些函式。以下按照英文字母排序列" -"出。" +"Python 直譯器有內建多個可隨時使用的函式和型別。以下按照英文字母排序列出。" #: ../../library/functions.rst:0 msgid "**A**" @@ -398,13 +397,13 @@ msgid ":func:`__import__`" msgstr ":func:`__import__`" #: ../../library/functions.rst:59 -#, fuzzy msgid "" "Return the absolute value of a number. The argument may be an integer, a " "floating point number, or an object implementing :meth:`__abs__`. If the " "argument is a complex number, its magnitude is returned." msgstr "" -"返回一個數的絕對值。實參可以是整數或浮點數。如果實參是一個複數,返回它的模。" +"回傳一個數的絕對值,引數可以是整數、浮點數或有實現 :meth:`__abs__` 的物件。如" +"果引數是一個複數,回傳它的純量(大小)。" #: ../../library/functions.rst:66 msgid "" @@ -417,13 +416,14 @@ msgid "Note: Unlike :func:`iter`, :func:`aiter` has no 2-argument variant." msgstr "" #: ../../library/functions.rst:75 -#, fuzzy msgid "" "Return ``True`` if all elements of the *iterable* are true (or if the " "iterable is empty). Equivalent to::" msgstr "" -"如果 *iterable* 的所有元素為 True(或 iterable 為空),返回 ``True`` 。等價" -"於::" +"如果 *iterable* 的所有元素皆為真(或 iterable 為空)則回傳 ``True``。等價" +"於:\n" +"\n" +"::" #: ../../library/functions.rst:87 msgid "" @@ -445,53 +445,49 @@ msgid "" msgstr "" #: ../../library/functions.rst:102 -#, fuzzy msgid "" "Return ``True`` if any element of the *iterable* is true. If the iterable " "is empty, return ``False``. Equivalent to::" msgstr "" -"如果 *iterable* 的任一元素為 True,返回 ``True`` 。如果 iterable 為空,返回 " -"``False``。等價於::" +"如果 *iterable* 的任一元素為真,回傳 ``True``。如果 iterable 是空的,則回傳 " +"``False``。等價於:\n" +"\n" +"::" #: ../../library/functions.rst:114 -#, fuzzy msgid "" "As :func:`repr`, return a string containing a printable representation of an " "object, but escape the non-ASCII characters in the string returned by :func:" "`repr` using ``\\x``, ``\\u``, or ``\\U`` escapes. This generates a string " "similar to that returned by :func:`repr` in Python 2." msgstr "" -"就像函式 :func:`repr`,返回一個物件可列印的字串,但是 :func:`repr` 返回的字串" -"中非 ASCII 編碼的字元,會使用 ``\\x``、``\\u`` 和 ``\\U`` 來轉義。生成的字串" -"和 Python 2 的 :func:`repr` 返回的結果相似。" +"就像函式 :func:`repr`,回傳一個表示物件的字串,但是 :func:`repr` 回傳的字串中" +"非 ASCII 編碼的字元會被跳脫 (escape),像是 ``\\x``、``\\u`` 和 ``\\U``。這個" +"函式生成的字串和 Python 2 的 :func:`repr` 回傳的結果相似。" #: ../../library/functions.rst:122 -#, fuzzy msgid "" "Convert an integer number to a binary string prefixed with \"0b\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " "object, it has to define an :meth:`__index__` method that returns an " "integer. Some examples:" msgstr "" -"將一個整數轉變為一個字首為“0b”的二進位制字串。結果是一個合法的 Python 表示" -"式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" -"`__index__` 方法返回一個整數。一些例子:" +"將一個整數轉變為一個前綴為 \"0b\" 的二進位制字串。結果是一個有效的 Python 運" +"算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" +"`__index__` method 回傳一個整數。舉例來說:" #: ../../library/functions.rst:132 -#, fuzzy msgid "" "If the prefix \"0b\" is desired or not, you can use either of the following " "ways." -msgstr "如果不一定需要字首“0b”,還可以使用如下的方法。" +msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。" #: ../../library/functions.rst:139 ../../library/functions.rst:804 #: ../../library/functions.rst:1099 -#, fuzzy msgid "See also :func:`format` for more information." -msgstr "另見 :func:`format` 獲取更多資訊。" +msgstr "可參考 :func:`format` 獲取更多資訊。" #: ../../library/functions.rst:144 -#, fuzzy msgid "" "Return a Boolean value, i.e. one of ``True`` or ``False``. *x* is converted " "using the standard :ref:`truth testing procedure `. If *x* is false " @@ -500,11 +496,11 @@ msgid "" "It cannot be subclassed further. Its only instances are ``False`` and " "``True`` (see :ref:`bltin-boolean-values`)." msgstr "" -"返回一個布林值,``True`` 或者 ``False``。 *x* 使用標準的 :ref:`真值測試過程 " -"` 來轉換。如果 *x* 是假的或者被省略,返回 ``False``;其他情況返回 " -"``True``。:class:`bool` 類是 :class:`int` 的子類(參見 :ref:" -"`typesnumeric`)。其他類不能繼承自它。它只有 ``False`` 和 ``True`` 兩個例項" -"(參見 :ref:`bltin-boolean-values`)。" +"回傳一個布林值,即 ``True`` 或者 ``False``。*x* 使用標準的\\ :ref:`真值測試程" +"序 `\\ 來轉換。如果 *x* 為假或者被省略,則回傳 ``False``;其他情況回" +"傳 ``True``。:class:`bool` class(類別)是 :class:`int` 的 subclass(子類別)" +"(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 " +"``True`` 兩個實例(參見 :ref:`bltin-boolean-values`)。" #: ../../library/functions.rst:153 ../../library/functions.rst:672 #: ../../library/functions.rst:888 @@ -530,101 +526,90 @@ msgid "" msgstr "" #: ../../library/functions.rst:176 -#, fuzzy msgid "" "Return a new array of bytes. The :class:`bytearray` class is a mutable " "sequence of integers in the range 0 <= x < 256. It has most of the usual " "methods of mutable sequences, described in :ref:`typesseq-mutable`, as well " "as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`." msgstr "" -"返回一個新的 bytes 陣列。 :class:`bytearray` 類是一個可變序列,包含範圍為 0 " -"<= x < 256 的整數。它有可變序列大部分常見的方法,見 :ref:`typesseq-mutable` " -"的描述;同時有 :class:`bytes` 型別的大部分方法,參見 :ref:`bytes-methods`。" +"回傳一個新的 bytes 陣列。\\ :class:`bytearray` class 是一個可變的整數序列,包" +"含範圍為 0 <= x < 256 的整數。它有可變序列大部分常見的 method(如在 :ref:" +"`typesseq-mutable` 中所述),同時也有 :class:`bytes` 型別大部分的 method,參" +"見 :ref:`bytes-methods`。" #: ../../library/functions.rst:181 -#, fuzzy msgid "" "The optional *source* parameter can be used to initialize the array in a few " "different ways:" -msgstr "可選形參 *source* 可以用不同的方式來初始化陣列:" +msgstr "選擇性參數 *source* 可以被用來以不同的方式初始化陣列:" #: ../../library/functions.rst:184 -#, fuzzy msgid "" "If it is a *string*, you must also give the *encoding* (and optionally, " "*errors*) parameters; :func:`bytearray` then converts the string to bytes " "using :meth:`str.encode`." msgstr "" -"如果是一個 *string*,您必須提供 *encoding* 引數(*errors* 引數仍是可選的);:" -"func:`bytearray` 會使用 :meth:`str.encode` 方法來將 string 轉變成 bytes。" +"如果是一個 *string*,你必須提供 *encoding* 參數(以及選擇性地提供 " +"*errors* );\\ :func:`bytearray` 會使用 :meth:`str.encode` method 來將 " +"string 轉變成 bytes。" #: ../../library/functions.rst:188 -#, fuzzy msgid "" "If it is an *integer*, the array will have that size and will be initialized " "with null bytes." msgstr "" -"如果是一個 *integer*,會初始化大小為該數字的陣列,並使用 null 位元組填充。" +"如果是一個 *integer*,陣列則會有該數值的長度,並以 null bytes 來當作初始值。" #: ../../library/functions.rst:191 -#, fuzzy msgid "" "If it is an object conforming to the :ref:`buffer interface " "`, a read-only buffer of the object will be used to " "initialize the bytes array." msgstr "" -"如果是一個符合 *buffer* 介面的物件,該物件的只讀 buffer 會用來初始化位元組陣" -"列。" +"如果是一個符合 :ref:`buffer 介面 `\\ 的物件,該物件的唯讀 " +"buffer 會被用來初始化 bytes 陣列。" #: ../../library/functions.rst:194 -#, fuzzy msgid "" "If it is an *iterable*, it must be an iterable of integers in the range ``0 " "<= x < 256``, which are used as the initial contents of the array." msgstr "" -"如果是一個 *iterable* 可迭代物件,它的元素的範圍必須是 ``0 <= x < 256`` 的整" -"數,它會被用作陣列的初始內容。" +"如果是一個 *iterable*,它的元素必須是範圍為 ``0 <= x < 256`` 的整數,並且會被" +"用作陣列的初始值。" #: ../../library/functions.rst:197 -#, fuzzy msgid "Without an argument, an array of size 0 is created." -msgstr "如果沒有實參,則建立大小為 0 的陣列。" +msgstr "如果沒有引數,則建立長度為 0 的陣列。" #: ../../library/functions.rst:199 -#, fuzzy msgid "See also :ref:`binaryseq` and :ref:`typebytearray`." -msgstr "另見 :ref:`binaryseq` 和 :ref:`typebytearray`。" +msgstr "可參考 :ref:`binaryseq` 和 :ref:`typebytearray`。" #: ../../library/functions.rst:206 -#, fuzzy msgid "" "Return a new \"bytes\" object which is an immutable sequence of integers in " "the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :" "class:`bytearray` -- it has the same non-mutating methods and the same " "indexing and slicing behavior." msgstr "" -"返回一個新的“bytes”物件, 是一個不可變序列,包含範圍為 ``0 <= x < 256`` 的整" -"數。:class:`bytes` 是 :class:`bytearray` 的不可變版本 - 它有其中不改變序列的" -"方法和相同的索引、切片操作。" +"回傳一個新的 \"bytes\" 物件,會是一個元素是範圍為 ``0 <= x < 256`` 整數的不可" +"變序列。:class:`bytes` 是 :class:`bytearray` 的不可變版本 — 它的同樣具備不改" +"變物件的 method,也有相同的索引和切片操作。" #: ../../library/functions.rst:211 -#, fuzzy msgid "" "Accordingly, constructor arguments are interpreted as for :func:`bytearray`." -msgstr "因此,建構函式的實參和 :func:`bytearray` 相同。" +msgstr "因此,建構函式的引數和 :func:`bytearray` 相同。" #: ../../library/functions.rst:213 -#, fuzzy msgid "Bytes objects can also be created with literals, see :ref:`strings`." -msgstr "位元組物件還可以用字面值建立,參見 :ref:`strings`。" +msgstr "Bytes 物件還可以用文字建立,參見 :ref:`strings`。" #: ../../library/functions.rst:215 -#, fuzzy msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`." -msgstr "另見 :ref:`binaryseq`,:ref:`typebytes` 和 :ref:`bytes-methods`。" +msgstr "可參考 :ref:`binaryseq`、\\ :ref:`typebytes` 和 :ref:`bytes-methods`。" #: ../../library/functions.rst:220 -#, fuzzy msgid "" "Return :const:`True` if the *object* argument appears callable, :const:" "`False` if not. If this returns ``True``, it is still possible that a call " @@ -632,81 +617,77 @@ msgid "" "that classes are callable (calling a class returns a new instance); " "instances are callable if their class has a :meth:`__call__` method." msgstr "" -"如果實參 *object* 是可呼叫的,返回 :const:`True`,否則返回 :const:`False`。如" -"果返回真,呼叫仍可能會失敗;但如果返回假,則呼叫 *object* 肯定會失敗。注意類" -"是可呼叫的(呼叫類會返回一個新的例項)。如果例項的類有 :meth:`__call__` 方" -"法,則它是可呼叫。" +"如果引數 *object* 是可呼叫的,回傳 :const:`True`,否則回傳 :const:`False`。如" +"果回傳 ``True``,呼叫仍可能會失敗;但如果回傳 ``False``,則呼叫 *object* 肯定" +"會失敗。注意 class 是可呼叫的(呼叫 class 會回傳一個新的實例);如果實例的 " +"class 有定義 :meth:`__call__` method,則它是可呼叫的。" #: ../../library/functions.rst:226 -#, fuzzy msgid "" "This function was first removed in Python 3.0 and then brought back in " "Python 3.2." -msgstr "這個函式一開始在 Python 3.0 被移除了,但在 Python 3.2 被重新加入。" +msgstr "這個函式一開始在 Python 3.0 被移除,但在 Python 3.2 又被重新加入。" #: ../../library/functions.rst:233 -#, fuzzy msgid "" "Return the string representing a character whose Unicode code point is the " "integer *i*. For example, ``chr(97)`` returns the string ``'a'``, while " "``chr(8364)`` returns the string ``'€'``. This is the inverse of :func:`ord`." msgstr "" -"返回 Unicode 碼位為整數 *i* 的字元的字串格式。例如,``chr(97)`` 返回字串 " -"``'a'``,``chr(8364)`` 返回字串 ``'€'``。這是 :func:`ord` 的逆函式。" +"回傳代表字元之 Unicode 編碼位置為整數 *i* 的字串。例如,``chr(97)`` 回傳字串 " +"``'a'``,而 ``chr(8364)`` 回傳字串 ``'€'``。這是 :func:`ord` 的逆函式。" #: ../../library/functions.rst:237 -#, fuzzy msgid "" "The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in " "base 16). :exc:`ValueError` will be raised if *i* is outside that range." msgstr "" -"實參的合法範圍是 0 到 1,114,111(16 進製表示是 0x10FFFF)。如果 *i* 超過這個" -"範圍,會觸發 :exc:`ValueError` 異常。" +"引數的有效範圍是 0 到 1,114,111(16 進制表示為 0x10FFFF)。如果 *i* 超過這個" +"範圍,會觸發 :exc:`ValueError`。" #: ../../library/functions.rst:243 -#, fuzzy msgid "Transform a method into a class method." -msgstr "把一個方法封裝成類方法。" +msgstr "把一個 method 封裝成 class method(類別方法)。" #: ../../library/functions.rst:245 -#, fuzzy msgid "" "A class method receives the class as an implicit first argument, just like " "an instance method receives the instance. To declare a class method, use " "this idiom::" msgstr "" -"一個類方法把類自己作為第一個實參,就像一個例項方法把例項自己作為第一個實參。" -"請用以下習慣來宣告類方法::" +"一個 class method 把自己的 class 作為第一個引數,就像一個實例 method 把實例自" +"己作為第一個引數。請用以下慣例來宣告 class method:\n" +"\n" +"::" #: ../../library/functions.rst:253 -#, fuzzy msgid "" "The ``@classmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." msgstr "" -"``@classmethod`` 形式是一個函式 :term:`decorator` - 參見 :ref:`function` 中關" +"``@classmethod`` 語法是一個函式 :term:`decorator` — 參見 :ref:`function` 中關" "於函式定義的詳細介紹。" #: ../../library/functions.rst:256 -#, fuzzy msgid "" "A class method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). The instance is ignored except for its " "class. If a class method is called for a derived class, the derived class " "object is passed as the implied first argument." msgstr "" -"它可以同時在類(如 ``C.f()``)和例項(如 ``C().f()``)上呼叫。例項除了它的類" -"資訊,其他都會被忽略。如果一個類方法在子類上呼叫,子類會作為第一個實參傳入。" +"一個 class method 可以在 class(如 ``C.f()``)或實例(如 ``C().f()``)上呼" +"叫。實例除了它的 class 資訊,其他都會被忽略。如果一個 class method 在 " +"subclass 上呼叫,subclass 會作為第一個引數傳入。" #: ../../library/functions.rst:261 -#, fuzzy msgid "" "Class methods are different than C++ or Java static methods. If you want " "those, see :func:`staticmethod` in this section. For more information on " "class methods, see :ref:`types`." msgstr "" -"類方法和 C++ 和 Java 的靜態方法是有區別的。如果你想要靜態方法,請看本節的 :" -"func:`staticmethod`。" +"Class method 和 C++ 與 Java 的 static method 是有區別的。如果你想瞭解 static " +"method,請看本節的 :func:`staticmethod`。關於 class method 的更多資訊,請參" +"考 :ref:`types`。" #: ../../library/functions.rst:265 msgid "" @@ -722,7 +703,6 @@ msgid "" msgstr "" #: ../../library/functions.rst:276 -#, fuzzy msgid "" "Compile the *source* into a code or AST object. Code objects can be " "executed by :func:`exec` or :func:`eval`. *source* can either be a normal " @@ -730,21 +710,19 @@ msgid "" "documentation for information on how to work with AST objects." msgstr "" "將 *source* 編譯成程式碼或 AST 物件。程式碼物件可以被 :func:`exec` 或 :func:" -"`eval` 執行。*source* 可以是常規的字串、位元組字串,或者 AST 物件。參見 :mod:" -"`ast` 模組的文件瞭解如何使用 AST 物件。" +"`eval` 執行。*source* 可以是一般的字串、bytes 字串、或者 AST 物件。參見 :mod:" +"`ast` module(模組)的文件瞭解如何使用 AST 物件。" #: ../../library/functions.rst:281 -#, fuzzy msgid "" "The *filename* argument should give the file from which the code was read; " "pass some recognizable value if it wasn't read from a file (``''`` " "is commonly used)." msgstr "" -"*filename* 實參需要是程式碼讀取的檔名;如果程式碼不需要從檔案中讀取,可以傳入" -"一些可辨識的值(經常會使用 ``''``)。" +"*filename* 引數必須是程式碼的檔名;如果程式碼不是從檔案中讀取,可以傳入一些可" +"辨識的值(經常會使用 ``''`` 來替代)。" #: ../../library/functions.rst:285 -#, fuzzy msgid "" "The *mode* argument specifies what kind of code must be compiled; it can be " "``'exec'`` if *source* consists of a sequence of statements, ``'eval'`` if " @@ -752,10 +730,10 @@ msgid "" "single interactive statement (in the latter case, expression statements that " "evaluate to something other than ``None`` will be printed)." msgstr "" -"*mode* 實參指定了編譯程式碼必須用的模式。如果 *source* 是語句序列,可以是 " -"``'exec'``;如果是單一表達式,可以是 ``'eval'``;如果是單個互動式語句,可以" -"是 ``'single'``。(在最後一種情況下,如果表示式執行結果不是 ``None`` 將會被打" -"印出來。)" +"*mode* 引數指定了編譯程式碼時必須用的模式。如果 *source* 是一系列的陳述式,可" +"以是 ``'exec'``;如果是單一運算式,可以是 ``'eval'``;如果是單個互動式陳述" +"式,可以是 ``'single'``(在最後一種情況下,如果運算式執行結果不是 ``None`` 則" +"會被印出來)。" #: ../../library/functions.rst:291 msgid "" @@ -772,7 +750,6 @@ msgid "" msgstr "" #: ../../library/functions.rst:302 -#, fuzzy msgid "" "Compiler options and future statements are specified by bits which can be " "bitwise ORed together to specify multiple options. The bitfield required to " @@ -781,12 +758,13 @@ msgid "" "instance in the :mod:`__future__` module. :ref:`Compiler flags ` can be found in :mod:`ast` module, with ``PyCF_`` prefix." msgstr "" -"Future 語句使用位元位來指定,多個語句可以通過按位或來指定。具體特性的位元位可" -"以通過 :mod:`__future__` 模組中的 :class:`~__future__._Feature` 類的例項的 :" -"attr:`~__future__._Feature.compiler_flag` 屬性來獲得。" +"編譯器選項和 future 陳述式使用 bits 來表示,可以一起被位元操作 OR 來表示複數" +"個選項。需要被具體定義特徵的位元域可以透過 :mod:`__future__` module 中 :" +"class:`~__future__._Feature` 實例中的 :attr:`~__future__._Feature." +"compiler_flag` 屬性來獲得。\\ :ref:`編譯器旗標 `\\ 可以" +"在 :mod:`ast` module 中搜尋有 ``PyCF_`` 前綴的名稱。" #: ../../library/functions.rst:310 -#, fuzzy msgid "" "The argument *optimize* specifies the optimization level of the compiler; " "the default value of ``-1`` selects the optimization level of the " @@ -794,25 +772,24 @@ msgid "" "optimization; ``__debug__`` is true), ``1`` (asserts are removed, " "``__debug__`` is false) or ``2`` (docstrings are removed too)." msgstr "" -"*optimize* 實參指定編譯器的優化級別;預設值 ``-1`` 選擇與直譯器的 :option:`-" -"O` 選項相同的優化級別。顯式級別為 ``0`` (沒有優化;``__debug__`` 為真)、" -"``1`` (斷言被刪除, ``__debug__`` 為假)或 ``2`` (文件字串也被刪除)。" +"引數 *optimize* 用來指定編譯器的最佳化級別;預設值 ``-1`` 選擇與直譯器的 :" +"option:`-O` 選項相同的最佳化級別。其他級別為 ``0``\\ (沒有最佳化;\\ " +"``__debug__`` 為真值)、\\ ``1``\\ (assert 被刪除,\\ ``__debug__`` 為假值)" +"或 ``2``\\ (文件字串也被刪除)。" #: ../../library/functions.rst:316 -#, fuzzy msgid "" "This function raises :exc:`SyntaxError` if the compiled source is invalid, " "and :exc:`ValueError` if the source contains null bytes." msgstr "" -"如果編譯的原始碼不合法,此函式會觸發 :exc:`SyntaxError` 異常;如果原始碼包含 " -"null 位元組,則會觸發 :exc:`ValueError` 異常。" +"如果編譯的原始碼無效,此函式會觸發 :exc:`SyntaxError`,如果原始碼包含 null " +"bytes,則會觸發 :exc:`ValueError`。" #: ../../library/functions.rst:319 -#, fuzzy msgid "" "If you want to parse Python code into its AST representation, see :func:`ast." "parse`." -msgstr "如果您想分析 Python 程式碼的 AST 表示,請參閱 :func:`ast.parse`。" +msgstr "如果您想解析 Python 程式碼為 AST 運算式,請參閱 :func:`ast.parse`。" #: ../../library/functions.rst:322 msgid "" @@ -828,41 +805,38 @@ msgid "" msgstr "" #: ../../library/functions.rst:330 -#, fuzzy msgid "" "When compiling a string with multi-line code in ``'single'`` or ``'eval'`` " "mode, input must be terminated by at least one newline character. This is " "to facilitate detection of incomplete and complete statements in the :mod:" "`code` module." msgstr "" -"在 ``'single'`` 或 ``'eval'`` 模式編譯多行程式碼字串時,輸入必須以至少一個換" -"行符結尾。 這使 :mod:`code` 模組更容易檢測語句的完整性。" +"在 ``'single'`` 或 ``'eval'`` 模式編譯多行程式碼時,輸入必須以至少一個換行符" +"結尾。這使 :mod:`code` module 更容易檢測陳述式的完整性。" #: ../../library/functions.rst:337 -#, fuzzy msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string when compiling to an AST object due to stack depth " "limitations in Python's AST compiler." msgstr "" "如果編譯足夠大或者足夠複雜的字串成 AST 物件時,Python 直譯器會因為 Python " -"AST 編譯器的棧深度限制而奔潰。" +"AST 編譯器的 stack 深度限制而崩潰。" #: ../../library/functions.rst:341 -#, fuzzy msgid "" "Allowed use of Windows and Mac newlines. Also, input in ``'exec'`` mode " "does not have to end in a newline anymore. Added the *optimize* parameter." msgstr "" -"允許使用 Windows 和 Mac 的換行符。在 ``'exec'`` 模式不再需要以換行符結尾。增" -"加了 *optimize* 形參。" +"允許使用 Windows 和 Mac 的換行符號。在 ``'exec'`` 模式不需要以換行符號結尾。" +"增加了 *optimize* 參數。" #: ../../library/functions.rst:345 -#, fuzzy msgid "" "Previously, :exc:`TypeError` was raised when null bytes were encountered in " "*source*." -msgstr "之前 *source* 中包含 null 位元組的話會觸發 :exc:`TypeError` 異常。" +msgstr "" +"在之前的版本,*source* 中包含 null bytes 會觸發 :exc:`TypeError` 異常。" #: ../../library/functions.rst:349 msgid "" @@ -871,7 +845,6 @@ msgid "" msgstr "" #: ../../library/functions.rst:356 -#, fuzzy msgid "" "Return a complex number with the value *real* + *imag*\\*1j or convert a " "string or number to a complex number. If the first parameter is a string, " @@ -882,11 +855,11 @@ msgid "" "conversion like :class:`int` and :class:`float`. If both arguments are " "omitted, returns ``0j``." msgstr "" -"返回值為 *real* + *imag*\\*1j 的複數,或將字串或數字轉換為複數。如果第一個形" -"參是字串,則它被解釋為一個複數,並且函式呼叫時必須沒有第二個形參。第二個形參" -"不能是字串。每個實參都可以是任意的數值型別(包括複數)。如果省略了 *imag*,則" +"回傳值為 *real* + *imag*\\*1j 的複數,或將字串、數字轉換為複數。如果第一個引" +"數是字串,則它被視為一個複數,並且函式呼叫時不得有第二個引數。第二個引數絕對" +"不能是字串。每個引數都可以是任意的數值型別(包括複數)。如果省略了 *imag*,則" "預設值為零,建構函式會像 :class:`int` 和 :class:`float` 一樣進行數值轉換。如" -"果兩個實參都省略,則返回 ``0j``。" +"果兩個引數都省略,則回傳 ``0j``。" #: ../../library/functions.rst:365 msgid "" @@ -897,26 +870,23 @@ msgid "" msgstr "" #: ../../library/functions.rst:372 -#, fuzzy msgid "" "When converting from a string, the string must not contain whitespace around " "the central ``+`` or ``-`` operator. For example, ``complex('1+2j')`` is " "fine, but ``complex('1 + 2j')`` raises :exc:`ValueError`." msgstr "" -"當從字串轉換時,字串在 ``+`` 或 ``-`` 的周圍必須不能有空格。例如 " -"``complex('1+2j')`` 是合法的,但 ``complex('1 + 2j')`` 會觸發 :exc:" -"`ValueError` 異常。" +"當轉換自一字串時,字串在 ``+`` 或 ``-`` 運算子的周圍必須不能有空格。例如 " +"``complex('1+2j')`` 是有效的,但 ``complex('1 + 2j')`` 會觸發 :exc:" +"`ValueError`。" #: ../../library/functions.rst:377 -#, fuzzy msgid "The complex type is described in :ref:`typesnumeric`." -msgstr ":ref:`typesnumeric` 描述了複數型別。" +msgstr "複數型別在 :ref:`typesnumeric` 中有相關描述。" #: ../../library/functions.rst:379 ../../library/functions.rst:669 #: ../../library/functions.rst:885 -#, fuzzy msgid "Grouping digits with underscores as in code literals is allowed." -msgstr "您可以使用下劃線將程式碼文字中的數字進行分組。" +msgstr "可以使用底線將程式碼文字中的數字進行分組。" #: ../../library/functions.rst:382 msgid "" @@ -925,59 +895,53 @@ msgid "" msgstr "" #: ../../library/functions.rst:389 -#, fuzzy msgid "" "This is a relative of :func:`setattr`. The arguments are an object and a " "string. The string must be the name of one of the object's attributes. The " "function deletes the named attribute, provided the object allows it. For " "example, ``delattr(x, 'foobar')`` is equivalent to ``del x.foobar``." msgstr "" -":func:`setattr` 相關的函式。實參是一個物件和一個字串。該字串必須是物件的某個" -"屬性。如果物件允許,該函式將刪除指定的屬性。例如 ``delattr(x, 'foobar')`` 等" -"價於 ``del x.foobar`` 。" +"這是 :func:`setattr` 相關的函式。引數是一個物件和一個字串,該字串必須是物件中" +"某個屬性名稱。如果物件允許,該函式將刪除指定的屬性。例如 ``delattr(x, " +"'foobar')`` 等價於 ``del x.foobar``。" #: ../../library/functions.rst:401 -#, fuzzy msgid "" "Create a new dictionary. The :class:`dict` object is the dictionary class. " "See :class:`dict` and :ref:`typesmapping` for documentation about this class." msgstr "" -"建立一個新的字典。:class:`dict` 物件是一個字典類。參見 :class:`dict` 和 :ref:" -"`typesmapping` 瞭解這個類。" +"建立一個新的 dictionary(字典)。\\ :class:`dict` 物件是一個 dictionary " +"class。參見 :class:`dict` 和 :ref:`typesmapping` 來瞭解這個 class。" #: ../../library/functions.rst:404 -#, fuzzy msgid "" "For other containers see the built-in :class:`list`, :class:`set`, and :" "class:`tuple` classes, as well as the :mod:`collections` module." msgstr "" -"其他容器型別,請參見內建的 :class:`list`、:class:`set` 和 :class:`tuple` 類," -"以及 :mod:`collections` 模組。" +"其他容器型別,請參見內建的 :class:`list`、:class:`set` 和 :class:`tuple` " +"class,以及 :mod:`collections` module。" #: ../../library/functions.rst:410 -#, fuzzy msgid "" "Without arguments, return the list of names in the current local scope. " "With an argument, attempt to return a list of valid attributes for that " "object." msgstr "" -"如果沒有實參,則返回當前本地作用域中的名稱列表。如果有實參,它會嘗試返回該物" +"如果沒有引數,則回傳當前本地作用域中的名稱列表。如果有引數,它會嘗試回傳該物" "件的有效屬性列表。" #: ../../library/functions.rst:413 -#, fuzzy msgid "" "If the object has a method named :meth:`__dir__`, this method will be called " "and must return the list of attributes. This allows objects that implement a " "custom :func:`__getattr__` or :func:`__getattribute__` function to customize " "the way :func:`dir` reports their attributes." msgstr "" -"如果物件有一個名為 :meth:`__dir__` 的方法,那麼該方法將被呼叫,並且必須返回一" -"個屬性列表。這允許實現自定義 :func:`__getattr__` 或 :func:`__getattribute__` " -"函式的物件能夠自定義 :func:`dir` 來報告它們的屬性。" +"如果物件有一個名為 :meth:`__dir__` 的 method,那麼該 method 將被呼叫,並且必" +"須回傳一個屬性列表。這允許實現自定義 :func:`__getattr__` 或 :func:" +"`__getattribute__` 函式的物件能夠自定義 :func:`dir` 來報告它們的屬性。" #: ../../library/functions.rst:418 -#, fuzzy msgid "" "If the object does not provide :meth:`__dir__`, the function tries its best " "to gather information from the object's :attr:`~object.__dict__` attribute, " @@ -990,48 +954,42 @@ msgstr "" "func:`__getattr__`,那結果可能不準確。" #: ../../library/functions.rst:423 -#, fuzzy msgid "" "The default :func:`dir` mechanism behaves differently with different types " "of objects, as it attempts to produce the most relevant, rather than " "complete, information:" msgstr "" -"預設的 :func:`dir` 機制對不同型別的物件行為不同,它會試圖返回最相關而不是最全" -"的資訊:" +"預設的 :func:`dir` 機制對不同型別的物件有不同行為,它會試圖回傳最相關而非最完" +"整的資訊:" #: ../../library/functions.rst:427 -#, fuzzy msgid "" "If the object is a module object, the list contains the names of the " "module's attributes." -msgstr "如果物件是模組物件,則列表包含模組的屬性名稱。" +msgstr "如果物件是 module 物件,則列表包含 module 的屬性名稱。" #: ../../library/functions.rst:430 -#, fuzzy msgid "" "If the object is a type or class object, the list contains the names of its " "attributes, and recursively of the attributes of its bases." msgstr "" -"如果物件是型別或類物件,則列表包含它們的屬性名稱,並且遞迴查詢所有基類的屬" -"性。" +"如果物件是型別或 class 物件,則列表包含它們的屬性名稱,並且遞迴查詢其基礎的所" +"有屬性。" #: ../../library/functions.rst:433 -#, fuzzy msgid "" "Otherwise, the list contains the object's attributes' names, the names of " "its class's attributes, and recursively of the attributes of its class's " "base classes." msgstr "" -"否則,列表包含物件的屬性名稱,它的類屬性名稱,並且遞迴查詢它的類的所有基類的" -"屬性。" +"否則,包含物件的屬性名稱列表、它的 class 屬性名稱,並且遞迴查詢它的 class 的" +"所有基礎 class 的屬性。" #: ../../library/functions.rst:437 -#, fuzzy msgid "The resulting list is sorted alphabetically. For example:" -msgstr "返回的列表按字母表排序。例如:" +msgstr "回傳的列表按字母表排序,例如:" #: ../../library/functions.rst:456 -#, fuzzy msgid "" "Because :func:`dir` is supplied primarily as a convenience for use at an " "interactive prompt, it tries to supply an interesting set of names more than " @@ -1039,12 +997,12 @@ msgid "" "its detailed behavior may change across releases. For example, metaclass " "attributes are not in the result list when the argument is a class." msgstr "" -"因為 :func:`dir` 主要是為了便於在互動式時使用,所以它會試圖返回人們感興趣的名" -"字集合,而不是試圖保證結果的嚴格性或一致性,它具體的行為也可能在不同版本之間" -"改變。例如,當實參是一個類時,metaclass 的屬性不包含在結果列表中。" +"因為 :func:`dir` 主要是為了便於在互動式提示字元時使用,所以它會試圖回傳人們感" +"興趣的名稱集合,而不是試圖保證結果的嚴格性或一致性,它具體的行為也可能在不同" +"版本之間改變。例如,當引數是一個 class 時,metaclass 的屬性不包含在結果列表" +"中。" #: ../../library/functions.rst:466 -#, fuzzy msgid "" "Take two (non-complex) numbers as arguments and return a pair of numbers " "consisting of their quotient and remainder when using integer division. " @@ -1055,14 +1013,14 @@ msgid "" "is very close to *a*, if ``a % b`` is non-zero it has the same sign as *b*, " "and ``0 <= abs(a % b) < abs(b)``." msgstr "" -"它將兩個(非複數)數字作為實參,並在執行整數除法時返回一對商和餘數。對於混合" -"運算元型別,適用雙目算術運算子的規則。對於整數,結果和 ``(a // b, a % b)`` 一" -"致。對於浮點數,結果是 ``(q, a % b)`` ,*q* 通常是 ``math.floor(a / b)`` 但可" -"能會比 1 小。在任何情況下, ``q * b + a % b`` 和 *a* 基本相等;如果 ``a % " -"b`` 非零,它的符號和 *b* 一樣,並且 ``0 <= abs(a % b) < abs(b)`` 。" +"它將兩個(非複數)數字作為引數,並在執行整數除法時回傳一對商和餘數。對於混合" +"運算元型別,適用二進位算術運算子的規則。對於整數,運算結果和 ``(a // b, a % " +"b)`` 一致。對於浮點數,運算結果是 ``(q, a % b)``,*q* 通常是 ``math." +"floor(a / b)`` 但可能會比 1 小。在任何情況下,``q * b + a % b`` 和 *a* 基本相" +"等,如果 ``a % b`` 非零,則它的符號和 *b* 一樣,且 ``0 <= abs(a % b) < " +"abs(b)``。" #: ../../library/functions.rst:478 -#, fuzzy msgid "" "Return an enumerate object. *iterable* must be a sequence, an :term:" "`iterator`, or some other object which supports iteration. The :meth:" @@ -1070,28 +1028,28 @@ msgid "" "returns a tuple containing a count (from *start* which defaults to 0) and " "the values obtained from iterating over *iterable*." msgstr "" -"返回一個列舉物件。*iterable* 必須是一個序列,或 :term:`iterator`,或其他支援" -"迭代的物件。 :func:`enumerate` 返回的迭代器的 :meth:`~iterator.__next__` 方法" -"返回一個元組,裡面包含一個計數值(從 *start* 開始,預設為 0)和通過迭代 " -"*iterable* 獲得的值。" +"回傳一個列舉 (enumerate) 物件。*iterable* 必須是一個序列、\\ :term:" +"`iterator` 或其他支援疊代的物件。\\ :func:`enumerate` 回傳之 iterator 的 :" +"meth:`~iterator.__next__` method 回傳一個 tuple(元組),裡面包含一個計數值" +"(從 *start* 開始,預設為 0)和通過疊代 *iterable* 獲得的值。" #: ../../library/functions.rst:490 -#, fuzzy msgid "Equivalent to::" -msgstr "等價於::" +msgstr "" +"等價於:\n" +"\n" +"::" #: ../../library/functions.rst:501 -#, fuzzy msgid "" "The arguments are a string and optional globals and locals. If provided, " "*globals* must be a dictionary. If provided, *locals* can be any mapping " "object." msgstr "" -"實參是一個字串,以及可選的 globals 和 locals。*globals* 實參必須是一個字典。" -"*locals* 可以是任何對映物件。" +"引數是一個字串,以及選擇性的 globals 和 locals。如果有提供選擇性引數," +"*globals* 必須是一個 dictionary。*locals* 可以是任何映射 (mapping) 物件。" #: ../../library/functions.rst:505 -#, fuzzy msgid "" "The *expression* argument is parsed and evaluated as a Python expression " "(technically speaking, a condition list) using the *globals* and *locals* " @@ -1107,13 +1065,15 @@ msgid "" "called. Note, *eval()* does not have access to the :term:`nested scopes " "` (non-locals) in the enclosing environment." msgstr "" -"*expression* 實參被剖析並執行成 Python 表示式(從技術上講,是條件列表)," -"*globals* 和 *locals* 字典分別用作全域性和本地名稱空間。如果 *globals* 字典存" -"在但缺少“__builtins__”,那麼當前的全域性變數會在剖析 *expression* 前被拷貝進 " -"*globals*;這意味著,*expression* 通常可以完全訪問標準的 :mod:`builtins` 模" -"組,並且受限制的環境會傳播。如果 *locals* 被省略了,那它的預設值是 *globals* " -"字典。如果兩個字典變數都被省略了,則在 :func:`eval` 被呼叫的環境中執行表示" -"式。函式的返回值是表示式執行的結果。語法錯誤會產生異常。如:" +"*expression* 引數被剖析並執行成 Python 運算式(技術上而言,是條件列表)," +"*globals* 和 *locals* dictionaries 分別用作全域性和本地命名空間。如果 " +"*globals* dictionary 存在但缺少 ``__builtins__`` 的鍵值,那 *expression* 被剖" +"析之前,將為該鍵插入對內建 :mod:`builtins` module dictionary 的引用。這麼一" +"來,在將 `__builtins__`` 傳入 :func:`eval` 之前,你可以透過將它插入 " +"*globals* 來控制你需要哪些內建函數。如果 *locals* 被省略,那它的預設值是 " +"*globals* dictionary。如果兩個 dictionary 變數都被省略,則在 :func:`eval` 被" +"呼叫的環境中執行運算式。請注意,*eval()* 在封閉環境中無法存取\\ :term:`巢狀" +"域 ` (non-locals)。" #: ../../library/functions.rst:520 msgid "" @@ -1122,28 +1082,26 @@ msgid "" msgstr "" #: ../../library/functions.rst:527 -#, fuzzy msgid "" "This function can also be used to execute arbitrary code objects (such as " "those created by :func:`compile`). In this case, pass a code object instead " "of a string. If the code object has been compiled with ``'exec'`` as the " "*mode* argument, :func:`eval`\\'s return value will be ``None``." msgstr "" -"這個函式也可以用來執行任何程式碼物件(如 :func:`compile` 建立的)。這種情況" -"下,引數是程式碼物件,而不是字串。如果編譯該物件時的 *mode* 實參是 " -"``'exec'`` 那麼 :func:`eval` 返回值為 ``None`` 。" +"這個函式也可以用來執行任意程式碼物件(如被 :func:`compile` 建立的那些)。這種" +"情況下,傳入的引數是程式碼物件而不是字串。如果編譯該物件時的 *mode* 引數是 " +"``'exec'``,那麼 :func:`eval` 回傳值為 ``None``。" #: ../../library/functions.rst:532 -#, fuzzy msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " "function. The :func:`globals` and :func:`locals` functions return the " "current global and local dictionary, respectively, which may be useful to " "pass around for use by :func:`eval` or :func:`exec`." msgstr "" -"提示: :func:`exec` 函式支援動態執行語句。 :func:`globals` 和 :func:`locals` " -"函式各自返回當前的全域性和本地字典,因此您可以將它們傳遞給 :func:`eval` 或 :" -"func:`exec` 來使用。" +"提示:\\ :func:`exec` 函式支援動態執行陳述式。\\ :func:`globals` 和 :func:" +"`locals` 函式分別回傳當前的全域性和局部性 dictionary,它們對於將引數傳遞給 :" +"func:`eval` 或 :func:`exec` 可能會方便許多。" #: ../../library/functions.rst:537 msgid "" @@ -1152,12 +1110,11 @@ msgid "" msgstr "" #: ../../library/functions.rst:540 -#, fuzzy msgid "" "See :func:`ast.literal_eval` for a function that can safely evaluate strings " "with expressions containing only literals." msgstr "" -"另外可以參閱 :func:`ast.literal_eval`,該函式可以安全執行僅包含文字的表示式字" +"另外可以參閱 :func:`ast.literal_eval`,該函式可以安全執行僅包含文字的運算式字" "串。" #: ../../library/functions.rst:543 ../../library/functions.rst:579 @@ -1173,7 +1130,6 @@ msgid "" msgstr "" #: ../../library/functions.rst:552 -#, fuzzy msgid "" "This function supports dynamic execution of Python code. *object* must be " "either a string or a code object. If it is a string, the string is parsed " @@ -1186,14 +1142,14 @@ msgid "" "passed to the :func:`exec` function. The return value is ``None``." msgstr "" "這個函式支援動態執行 Python 程式碼。*object* 必須是字串或者程式碼物件。如果是" -"字串,那麼該字串將被剖析為一系列 Python 語句並執行(除非發生語法錯誤)。[#]_ " -"如果是程式碼物件,它將被直接執行。在任何情況下,被執行的程式碼都需要和檔案輸" -"入一樣是有效的(見參考手冊中關於檔案輸入的章節)。請注意即使在傳遞給 :func:" -"`exec` 函式的程式碼的上下文中,:keyword:`return` 和 :keyword:`yield` 語句也不" -"能在函式定義之外使用。該函式返回值是 ``None`` 。" +"字串,那麼該字串將被剖析為一系列 Python 陳述式並執行(除非發生語法錯誤)。" +"[#]_ 如果是程式碼物件,它將被直接執行。無論哪種情況,被執行的程式碼都需要和檔" +"案輸入一樣是有效的(可參考手冊中關於 :ref:`file-input` 的章節)。請注意,即使" +"在傳遞給 :func:`exec` 函式的程式碼的上下文中,:keyword:`nonlocal`、:keyword:" +"`yield` 和 :keyword:`return` 陳述式也不能在函式之外使用。該函式回傳值是 " +"``None``。" #: ../../library/functions.rst:563 -#, fuzzy msgid "" "In all cases, if the optional parts are omitted, the code is executed in the " "current scope. If only *globals* is provided, it must be a dictionary (and " @@ -1205,15 +1161,14 @@ msgid "" "*locals*, the code will be executed as if it were embedded in a class " "definition." msgstr "" -"無論哪種情況,如果省略了可選引數,程式碼將在當前範圍內執行。如果提供了 " -"*globals* 引數,就必須是字典型別,而且會被用作全域性和本地變數。如果同時提供" -"了 *globals* 和 *locals* 引數,它們分別被用作全域性和本地變數。如果提供了 " -"*locals* 引數,則它可以是任何對映型的物件。請記住在模組層級,全域性和本地變數" -"是相同的字典。如果 exec 有兩個不同的 *globals* 和 *locals* 物件,程式碼就像嵌" -"入在類定義中一樣執行。" +"無論哪種情況,如果省略了選擇性引數,程式碼將在當前作用域內執行。如果只提供了 " +"*globals* 引數,就必須是 dictionary 型別,而且會被用作全域性和本地變數。如果" +"同時提供了 *globals* 和 *locals* 引數,它們分別被用作全域性和本地變數。如果提" +"供了 *locals* 引數,則它可以是任何映射物件。請記住在 module 層級中全域性和本" +"地變數是相同的 dictionary。如果 exec 有兩個不同的 *globals* 和 *locals* 物" +"件,程式碼就像嵌入在 class 定義中一樣執行。" #: ../../library/functions.rst:573 -#, fuzzy msgid "" "If the *globals* dictionary does not contain a value for the key " "``__builtins__``, a reference to the dictionary of the built-in module :mod:" @@ -1221,23 +1176,21 @@ msgid "" "builtins are available to the executed code by inserting your own " "``__builtins__`` dictionary into *globals* before passing it to :func:`exec`." msgstr "" -"如果 *globals* 字典不包含 ``__builtins__`` 鍵值,則將為該鍵插入對內建 :mod:" -"`builtins` 模組字典的引用。因此,在將執行的程式碼傳遞給 :func:`exec` 之前,可" -"以通過將自己的 ``__builtins__`` 字典插入到 *globals* 中來控制可以使用哪些內建" -"程式碼。" +"如果 *globals* dictionary 不包含 ``__builtins__`` 鍵值,則將為該鍵插入對內" +"建 :mod:`builtins` module dictionary 的引用。因此,在將執行的程式碼傳遞給 :" +"func:`exec` 之前,可以通過將自己的 ``__builtins__`` dictionary 插入到 " +"*globals* 中來控制可以使用哪些內建程式碼。" #: ../../library/functions.rst:586 -#, fuzzy msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " "global and local dictionary, respectively, which may be useful to pass " "around for use as the second and third argument to :func:`exec`." msgstr "" -"內建 :func:`globals` 和 :func:`locals` 函式各自返回當前的全域性和本地字典,因" -"此可以將它們傳遞給 :func:`exec` 的第二個和第三個實參。" +"內建 :func:`globals` 和 :func:`locals` 函式各自回傳當前的全域性和本地 " +"dictionary,因此可以將它們傳遞給 :func:`exec` 的第二個和第三個引數。" #: ../../library/functions.rst:592 -#, fuzzy msgid "" "The default *locals* act as described for function :func:`locals` below: " "modifications to the default *locals* dictionary should not be attempted. " @@ -1245,11 +1198,10 @@ msgid "" "on *locals* after function :func:`exec` returns." msgstr "" "預設情況下,*locals* 的行為如下面 :func:`locals` 函式描述的一樣:不要試圖改變" -"預設的 *locals* 字典。如果您想在 :func:`exec` 函式返回時知道程式碼對 " -"*locals* 的變動,請明確地傳遞 *locals* 字典。" +"預設的 *locals* dictionary。如果您想在 :func:`exec` 函式回傳時知道程式碼對 " +"*locals* 的變動,請明確地傳遞 *locals* dictionary 。" #: ../../library/functions.rst:600 -#, fuzzy msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "returns true. *iterable* may be either a sequence, a container which " @@ -1257,39 +1209,35 @@ msgid "" "function is assumed, that is, all elements of *iterable* that are false are " "removed." msgstr "" -"用 *iterable* 中函式 *function* 返回真的那些元素,構建一個新的迭代器。" -"*iterable* 可以是一個序列,一個支援迭代的容器,或一個迭代器。如果 *function* " -"是 ``None`` ,則會假設它是一個身份函式,即 *iterable* 中所有返回假的元素會被" -"移除。" +"用 *iterable* 中函式 *function* 回傳 True 的那些元素,構建一個新的 iterator。" +"*iterable* 可以是一個序列、一個支援疊代的容器、或一個 iterator。如果 " +"*function* 是 ``None``,則會假設它是一個恆等函數,即 *iterable* 中所有假值元" +"素會被移除。" #: ../../library/functions.rst:606 -#, fuzzy msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " "not ``None`` and ``(item for item in iterable if item)`` if function is " "``None``." msgstr "" -"請注意, ``filter(function, iterable)`` 相當於一個生成器表示式,當 function " -"不是 ``None`` 的時候為 ``(item for item in iterable if function(item))``;" -"function 是 ``None`` 的時候為 ``(item for item in iterable if item)`` 。" +"請注意,``filter(function, iterable)`` 相當於一個生成器運算式,當 function 不" +"是 ``None`` 的時候為 ``(item for item in iterable if function(item))``;" +"function 是 ``None`` 的時候為 ``(item for item in iterable if item)``。" #: ../../library/functions.rst:611 -#, fuzzy msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* returns false." msgstr "" -"請參閱 :func:`itertools.filterfalse` 瞭解,只有 *function* 返回 false 時才選" -"取 *iterable* 中元素的補充函式。" +"請參閱 :func:`itertools.filterfalse`,只有 *function* 回傳 false 時才選取 " +"*iterable* 中元素的互補函數。" #: ../../library/functions.rst:621 -#, fuzzy msgid "Return a floating point number constructed from a number or string *x*." -msgstr "返回從數字或字串 *x* 生成的浮點數。" +msgstr "回傳從數字或字串 *x* 生成的浮點數。" #: ../../library/functions.rst:623 -#, fuzzy msgid "" "If the argument is a string, it should contain a decimal number, optionally " "preceded by a sign, and optionally embedded in whitespace. The optional " @@ -1299,85 +1247,80 @@ msgid "" "conform to the following grammar after leading and trailing whitespace " "characters are removed:" msgstr "" -"如果實參是字串,則它必須是包含十進位制數字的字串,字串前面可以有符號,之前也" -"可以有空格。可選的符號有 ``'+'`` 和 ``'-'`` ; ``'+'`` 對建立的值沒有影響。實" -"參也可以是 NaN(非數字)、正負無窮大的字串。確切地說,除去首尾的空格後,輸入" +"如果引數是字串,則它必須是包含十進位制數字的字串,字串前面可以有符號,之前也" +"可以有空格。選擇性的符號有 ``'+'`` 和 ``'-'``;``'+'`` 對建立的值沒有影響。引" +"數也可以是 NaN(非數字)或正負無窮大的字串。確切地說,除去首尾的空格後,輸入" "必須遵循以下語法:" #: ../../library/functions.rst:638 -#, fuzzy msgid "" "Here ``floatnumber`` is the form of a Python floating-point literal, " "described in :ref:`floating`. Case is not significant, so, for example, " "\"inf\", \"Inf\", \"INFINITY\", and \"iNfINity\" are all acceptable " "spellings for positive infinity." msgstr "" -"這裡, ``floatnumber`` 是 Python 浮點數的字串形式,詳見 :ref:`floating`。字母" -"大小寫都可以,例如,“inf”、“Inf”、“INFINITY”、“iNfINity” 都可以表示正無窮大。" +"``floatnumber`` 是 Python 浮點數的字串形式,詳見 :ref:`floating`。字母大小寫" +"都可以,例如,\"inf\"、\"Inf\"、\"INFINITY\"、\"iNfINity\" 都可以表示正無窮" +"大。" #: ../../library/functions.rst:643 -#, fuzzy msgid "" "Otherwise, if the argument is an integer or a floating point number, a " "floating point number with the same value (within Python's floating point " "precision) is returned. If the argument is outside the range of a Python " "float, an :exc:`OverflowError` will be raised." msgstr "" -"另一方面,如果實參是整數或浮點數,則返回具有相同值(在 Python 浮點精度範圍" -"內)的浮點數。如果實參在 Python 浮點精度範圍外,則會觸發 :exc:" -"`OverflowError`。" +"否則,如果引數是整數或浮點數,則回傳具有相同值(在 Python 浮點精度範圍內)的" +"浮點數。如果引數在 Python 浮點精度範圍外,則會觸發 :exc:`OverflowError`。" #: ../../library/functions.rst:648 -#, fuzzy msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If ``__float__()`` is not defined then it falls back to :" "meth:`__index__`." msgstr "" -"對於一般的 Python 物件 ``x`` , ``float(x)`` 指派給 ``x.__float__()`` 。" +"對於一般的 Python 物件 ``x``,``float(x)`` 指派給 ``x.__float__()``。如果未定" +"義 ``__float__()`` 則使用 :meth:`__index__`。" #: ../../library/functions.rst:652 -#, fuzzy msgid "If no argument is given, ``0.0`` is returned." -msgstr "如果沒有實參,則返回 ``0.0`` 。" +msgstr "如果沒有引數,則回傳 ``0.0``。" #: ../../library/functions.rst:654 -#, fuzzy msgid "Examples::" -msgstr "例如::" +msgstr "" +"例如:\n" +"\n" +"::" #: ../../library/functions.rst:667 -#, fuzzy msgid "The float type is described in :ref:`typesnumeric`." -msgstr ":ref:`typesnumeric` 描述了浮點型別。" +msgstr ":ref:`typesnumeric` 描述了浮點數型別。" #: ../../library/functions.rst:675 msgid "Falls back to :meth:`__index__` if :meth:`__float__` is not defined." msgstr "" #: ../../library/functions.rst:685 -#, fuzzy msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " "of the *value* argument; however, there is a standard formatting syntax that " "is used by most built-in types: :ref:`formatspec`." msgstr "" -"將 *value* 轉換為 *format_spec* 控制的“格式化”表示。*format_spec* 的解釋取決" -"於 *value* 實參的型別,但是大多數內建型別使用標準格式化語法::ref:" +"將 *value* 轉換為 *format_spec* 控制的 \"格式化\" 表示。*format_spec* 的解釋" +"取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語法::ref:" "`formatspec`。" #: ../../library/functions.rst:690 -#, fuzzy msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." msgstr "" -"預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value)` 的結" +"預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value) ` 的效" "果相同。" #: ../../library/functions.rst:693 -#, fuzzy msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1386,42 +1329,38 @@ msgid "" "*format_spec* is non-empty, or if either the *format_spec* or the return " "value are not strings." msgstr "" -"呼叫 ``format(value, format_spec)`` 會轉換成 ``type(value)." -"__format__(value, format_spec)`` ,所以例項字典中的 :meth:`__format__` 方法將" -"不會呼叫。如果搜尋到 :mod:`object` 有這個方法但 *format_spec* 不為空," -"*format_spec* 或返回值不是字串,會觸發 :exc:`TypeError` 異常。" +"呼叫 ``format(value, format_spec)`` 會轉換成 ``type(value).__format__(value, " +"format_spec)``,當搜尋 value 的 :meth:`__format__` method 時,會忽略實例中的" +"字典。如果搜尋到 :mod:`object` 這個 method 但 *format_spec* 不為空,或是 " +"*format_spec* 或回傳值不是字串,則會觸發 :exc:`TypeError`。" #: ../../library/functions.rst:700 -#, fuzzy msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." msgstr "" -"當 *format_spec* 不是空字串時, ``object().__format__(format_spec)`` 會觸" -"發 :exc:`TypeError`。" +"當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會觸發 :" +"exc:`TypeError`。" #: ../../library/functions.rst:709 -#, fuzzy msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" "ref:`types-set` for documentation about this class." msgstr "" -"返回一個新的 :class:`frozenset` 物件,它包含可選引數 *iterable* 中的元素。 " -"``frozenset`` 是一個內建的類。有關此類的文件,請參閱 :class:`frozenset` 和 :" -"ref:`types-set`。" +"回傳一個新的 :class:`frozenset` 物件,它包含選擇性引數 *iterable* 中的元" +"素。\\ ``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" +"`frozenset` 和 :ref:`types-set`。" #: ../../library/functions.rst:713 -#, fuzzy msgid "" "For other containers see the built-in :class:`set`, :class:`list`, :class:" "`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " -"類,以及 :mod:`collections` 模組來了解其它的容器。" +"class,以及 :mod:`collections` module 來了解其它的容器。" #: ../../library/functions.rst:720 -#, fuzzy msgid "" "Return the value of the named attribute of *object*. *name* must be a " "string. If the string is the name of one of the object's attributes, the " @@ -1430,9 +1369,10 @@ msgid "" "exist, *default* is returned if provided, otherwise :exc:`AttributeError` is " "raised." msgstr "" -"返回物件命名屬性的值。*name* 必須是字串。如果該字串是物件的屬性之一,則返回該" -"屬性的值。例如, ``getattr(x, 'foobar')`` 等同於 ``x.foobar``。如果指定的屬性" -"不存在,且提供了 *default* 值,則返回它,否則觸發 :exc:`AttributeError`。" +"回傳 *object* 之具名屬性的值。*name* 必須是字串。如果該字串是物件屬性之一的名" +"稱,則回傳該屬性的值。例如,``getattr(x, 'foobar')`` 等同於 ``x.foobar``。如" +"果指定的屬性不存在,且提供了 *default* 值,則回傳其值,否則觸發 :exc:" +"`AttributeError`。" #: ../../library/functions.rst:728 msgid "" @@ -1443,51 +1383,46 @@ msgid "" msgstr "" #: ../../library/functions.rst:736 -#, fuzzy msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " "same regardless of where the function is called." msgstr "" -"返回表示當前全域性符號表的字典。這總是當前模組的字典(在函式或方法中,不是呼" -"叫它的模組,而是定義它的模組)。" +"回傳代表當前 module 命名空間的 dictionary。對於在函式中的程式碼來說,這在定義" +"函式時設定且不論該函式是在何處呼叫都會保持相同。" #: ../../library/functions.rst:743 -#, fuzzy msgid "" "The arguments are an object and a string. The result is ``True`` if the " "string is the name of one of the object's attributes, ``False`` if not. " "(This is implemented by calling ``getattr(object, name)`` and seeing whether " "it raises an :exc:`AttributeError` or not.)" msgstr "" -"該實參是一個物件和一個字串。如果字串是物件的屬性之一的名稱,則返回 ``True``," -"否則返回 ``False``。(此功能是通過呼叫 ``getattr(object, name)`` 看是否有 :" -"exc:`AttributeError` 異常來實現的。)" +"該引數是一個物件和一個字串。如果字串是物件屬性之一的名稱,則回傳 ``True``,否" +"則回傳 ``False``。(此功能是通過呼叫 ``getattr(object, name)`` 看是否有 :exc:" +"`AttributeError` 來實現的。)" #: ../../library/functions.rst:751 -#, fuzzy msgid "" "Return the hash value of the object (if it has one). Hash values are " "integers. They are used to quickly compare dictionary keys during a " "dictionary lookup. Numeric values that compare equal have the same hash " "value (even if they are of different types, as is the case for 1 and 1.0)." msgstr "" -"返回該物件的雜湊值(如果它有的話)。雜湊值是整數。它們在字典查詢元素時用來快" -"速比較字典的鍵。相同大小的數字變數有相同的雜湊值(即使它們型別不同,如 1 和 " -"1.0)。" +"回傳該物件的雜湊值(如果它有的話)。雜湊值是整數。它們在 dictionary 查詢元素" +"時用來快速比較 dictionary 的鍵。相同大小的數字數值有相同的雜湊值(即使它們型" +"別不同,如 1 和 1.0)。" #: ../../library/functions.rst:758 -#, fuzzy msgid "" "For objects with custom :meth:`__hash__` methods, note that :func:`hash` " "truncates the return value based on the bit width of the host machine. See :" "meth:`__hash__` for details." msgstr "" -"如果物件實現了自己的 :meth:`__hash__` 方法,請注意,:func:`hash` 根據機器的字" -"長來截斷返回值。另請參閱 :meth:`__hash__`。" +"請注意,如果物件實現了自己的 :meth:`__hash__` method,:func:`hash` 根據執行機" +"器的位元長度來擷取回傳值。另請參閱 :meth:`__hash__`。" #: ../../library/functions.rst:764 -#, fuzzy msgid "" "Invoke the built-in help system. (This function is intended for interactive " "use.) If no argument is given, the interactive help system starts on the " @@ -1496,10 +1431,10 @@ msgid "" "documentation topic, and a help page is printed on the console. If the " "argument is any other kind of object, a help page on the object is generated." msgstr "" -"啟動內建的幫助系統(此函式主要在互動式中使用)。如果沒有實參,直譯器控制檯裡" -"會啟動互動式幫助系統。如果實參是一個字串,則在模組、函式、類、方法、關鍵字或" -"文件主題中搜索該字串,並在控制檯上列印幫助資訊。如果實參是其他任意物件,則會" -"生成該物件的幫助頁。" +"啟動內建的幫助系統(此函式主要以互動式使用)。如果沒有引數,直譯器控制臺裡會" +"啟動互動式幫助系統。如果引數是一個字串,則在 module、函式、class、method、關" +"鍵字或文件主題中搜索該字串,並在控制台上列印幫助資訊。如果引數是其他任意物" +"件,則會生成該物件的幫助頁。" #: ../../library/functions.rst:771 msgid "" @@ -1510,63 +1445,59 @@ msgid "" msgstr "" #: ../../library/functions.rst:776 -#, fuzzy msgid "" "This function is added to the built-in namespace by the :mod:`site` module." -msgstr "該函式通過 :mod:`site` 模組加入到內建名稱空間。" +msgstr "該函式透過 :mod:`site` module 加入到內建命名空間。" #: ../../library/functions.rst:778 -#, fuzzy msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." msgstr "" -":mod:`pydoc` 和 :mod:`inspect` 的變更使得可呼叫物件的簽名信息更加全面和一致。" +"變更至 :mod:`pydoc` 和 :mod:`inspect` 使得可呼叫物件的簽名信息 (signature) 更" +"加全面和一致。" #: ../../library/functions.rst:785 -#, fuzzy msgid "" "Convert an integer number to a lowercase hexadecimal string prefixed with " "\"0x\". If *x* is not a Python :class:`int` object, it has to define an :" "meth:`__index__` method that returns an integer. Some examples:" msgstr "" -"將整數轉換為以“0x”為字首的小寫十六進位制字串。如果 *x* 不是 Python :class:" -"`int` 物件,則必須定義返回整數的 :meth:`__index__` 方法。一些例子:" +"將整數轉換為以 \"0x\" 為前綴的小寫十六進位制字串。如果 *x* 不是 Python :" +"class:`int` 物件,則必須定義一個 :meth:`__index__` method 並且回傳一個整數。" +"舉例來說:" #: ../../library/functions.rst:794 -#, fuzzy msgid "" "If you want to convert an integer number to an uppercase or lower " "hexadecimal string with prefix or not, you can use either of the following " "ways:" msgstr "" -"如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無“0x”字首,則可以使" -"用如下方法:" +"如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無 \"0x\" 前綴,則可" +"以使用如下方法:" #: ../../library/functions.rst:806 -#, fuzzy msgid "" "See also :func:`int` for converting a hexadecimal string to an integer using " "a base of 16." msgstr "另請參閱 :func:`int` 將十六進位制字串轉換為以 16 為基數的整數。" #: ../../library/functions.rst:811 -#, fuzzy msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." -msgstr "如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` 方法。" +msgstr "" +"如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` method。" #: ../../library/functions.rst:817 -#, fuzzy msgid "" "Return the \"identity\" of an object. This is an integer which is " "guaranteed to be unique and constant for this object during its lifetime. " "Two objects with non-overlapping lifetimes may have the same :func:`id` " "value." msgstr "" -"返回物件的“標識值”。該值是一個整數,在此物件的生命週期中保證是唯一且恆定的。" -"兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" +"回傳物件的 \"標識值\" 。該值是一個整數,在此物件的生命週期中保證是唯一且恆定" +"的。兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" #: ../../library/functions.rst:824 msgid "" @@ -1575,25 +1506,25 @@ msgid "" msgstr "" #: ../../library/functions.rst:829 -#, fuzzy msgid "" "If the *prompt* argument is present, it is written to standard output " "without a trailing newline. The function then reads a line from input, " "converts it to a string (stripping a trailing newline), and returns that. " "When EOF is read, :exc:`EOFError` is raised. Example::" msgstr "" -"如果存在 *prompt* 實參,則將其寫入標準輸出,末尾不帶換行符。接下來,該函式從" -"輸入中讀取一行,將其轉換為字串(除了末尾的換行符)並返回。當讀取到 EOF 時,則" -"觸發 :exc:`EOFError`。例如::" +"如果有提供 *prompt* 引數,則將其寫入標準輸出,末尾不帶換行符。接下來,該函式" +"從輸入中讀取一行,將其轉換為字串(去除末尾的換行符)並回傳。當讀取到 EOF 時," +"則觸發 :exc:`EOFError`。例如:\n" +"\n" +"::" #: ../../library/functions.rst:839 -#, fuzzy msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." msgstr "" -"如果載入了 :mod:`readline` 模組,:func:`input` 將使用它來提供複雜的行編輯和歷" -"史記錄功能。" +"如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" +"歷史記錄功能。" #: ../../library/functions.rst:842 msgid "" @@ -1620,7 +1551,6 @@ msgid "" msgstr "" #: ../../library/functions.rst:856 -#, fuzzy msgid "" "Return an integer object constructed from a number or string *x*, or return " "``0`` if no arguments are given. If *x* defines :meth:`__int__`, ``int(x)`` " @@ -1628,12 +1558,12 @@ msgid "" "__index__()``. If *x* defines :meth:`__trunc__`, it returns ``x." "__trunc__()``. For floating point numbers, this truncates towards zero." msgstr "" -"返回一個使用數字或字串 *x* 生成的整數物件,或者沒有實參的時候返回 ``0`` 。如" -"果 *x* 定義了 :meth:`__int__`,``int(x)`` 返回 ``x.__int__()`` 。如果 *x* 定" -"義了 :meth:`__trunc__`,它返回 ``x.__trunc__()`` 。對於浮點數,它向零舍入。" +"回傳一個使用數字或字串 *x* 建構的整數物件,或者在沒有引數時回傳 ``0``。如果 " +"*x* 定義了 :meth:`__int__`,``int(x)`` 回傳 ``x.__int__()``。如果 *x* 定義" +"了 :meth:`__index__` 則回傳 ``x.__index__()``。如果 *x* 定義了 :meth:" +"`__trunc__` 則回傳 ``x.__trunc__()``。對於浮點數則向零舍入。" #: ../../library/functions.rst:863 -#, fuzzy msgid "" "If *x* is not a number or if *base* is given, then *x* must be a string, :" "class:`bytes`, or :class:`bytearray` instance representing an :ref:`integer " @@ -1648,40 +1578,37 @@ msgid "" "``int('010', 0)`` is not legal, while ``int('010')`` is, as well as " "``int('010', 8)``." msgstr "" -"如果 *x* 不是數字,或者有 *base* 引數,*x* 必須是字串、:class:`bytes`、表示進" -"製為 *base* 的 :ref:`整數文字` 的 :class:`bytearray` 例項。該文字前" -"可以有 ``+`` 或 ``-`` (中間不能有空格),前後可以有空格。一個進製為 n 的數字" -"包含 0 到 n-1 的數,其中 ``a`` 到 ``z`` (或 ``A`` 到 ``Z`` )表示 10 到 35。" -"預設的 *base* 為 10 ,允許的進位制有 0、2-36。2、8、16 進位制的數字可以在程式" -"碼中用 ``0b``/``0B`` 、 ``0o``/``0O`` 、 ``0x``/``0X`` 字首來表示。進製為 0 " -"將安照程式碼的字面量來精確解釋,最後的結果會是 2、8、10、16 進制中的一個。所" -"以 ``int('010', 0)`` 是非法的,但 ``int('010')`` 和 ``int('010', 8)`` 是合法" -"的。" +"如果 *x* 不是數字,或者有 *base* 引數,*x* 必須是字串、:class:`bytes`、或進位" +"制為 *base* 的\\ :ref:`整數文字 `\\ 的 :class:`bytearray` 實例。該" +"文字前可以有 ``+`` 或 ``-``\\ (中間不能有空格),前後可以有空格。一個進製為 " +"n 的文字包含 0 到 n-1,其中 ``a`` 到 ``z``\\ (或 ``A`` 到 ``Z`` )表示 10 " +"到 35。預設的 *base* 為 10 。允許的進位制有 0、2–36。2、8、16 進位制的文字可" +"以在程式碼中用 ``0b``/``0B``、``0o``/``0O``、``0x``/``0X`` 前綴來表示,如同程" +"式碼中的整數文字。進位制為 0 將按照程式碼的字面進位制來直譯,最後的結果會是 " +"2、8、10、16 進制中的一個,所以 ``int('010', 0)`` 是非法的,但 " +"``int('010')`` 和 ``int('010', 8)`` 是有效的。" #: ../../library/functions.rst:876 -#, fuzzy msgid "The integer type is described in :ref:`typesnumeric`." -msgstr "整數型別定義請參閱 :ref:`typesnumeric` 。" +msgstr "整數型別定義請參閱 :ref:`typesnumeric`。" #: ../../library/functions.rst:878 -#, fuzzy msgid "" "If *base* is not an instance of :class:`int` and the *base* object has a :" "meth:`base.__index__ ` method, that method is called to " "obtain an integer for the base. Previous versions used :meth:`base.__int__ " "` instead of :meth:`base.__index__ `." msgstr "" -"如果 *base* 不是 :class:`int` 的例項,但 *base* 物件有 :meth:`base.__index__ " -"` 方法,則會呼叫該方法來獲取進位制數。以前的版本使用 :meth:" -"`base.__int__ ` 而不是 :meth:`base.__index__ `。" +"如果 *base* 不是 :class:`int` 的實例,但 *base* 物件有 :meth:`base.__index__ " +"` method,則會呼叫該 method 來獲取此進位制整數。以前的版本" +"使用 :meth:`base.__int__ ` 而不是 :meth:`base.__index__ " +"`。" #: ../../library/functions.rst:891 msgid "Falls back to :meth:`__index__` if :meth:`__int__` is not defined." msgstr "" #: ../../library/functions.rst:897 -#, fuzzy msgid "" "Return ``True`` if the *object* argument is an instance of the *classinfo* " "argument, or of a (direct, indirect, or :term:`virtual `)子類的例項,則返回 true。如果 *object* 不是給定型別的" -"物件,函式始終返回 false。如果 *classinfo* 是物件型別(或多個遞迴元組)的元" -"組,如果 *object* 是其中的任何一個的例項則返回 true。 如果 *classinfo* 既不是" -"型別,也不是型別元組或型別的遞迴元組,那麼會觸發 :exc:`TypeError` 異常。" +"如果 *object* 引數是 *classinfo* 引數的實例,或者是(直接、間接或 :term:" +"`virtual `)subclass 的實例,則回傳 ``True``。如果 " +"*object* 不是給定型別的物件,函式始終回傳 ``False``。如果 *classinfo* 是包含" +"物件型別的 tuple(或多個遞迴 tuple)或一個包含多種型別的 :ref:`types-union`," +"若 *object* 是其中的任何一個物件的實例則回傳 ``True``。如果 *classinfo* 既不" +"是型別,也不是型別 tuple 或型別的遞迴 tuple,那麼會觸發 :exc:`TypeError` 異" +"常。" #: ../../library/functions.rst:907 ../../library/functions.rst:920 msgid "*classinfo* can be a :ref:`types-union`." msgstr "" #: ../../library/functions.rst:913 -#, fuzzy msgid "" "Return ``True`` if *class* is a subclass (direct, indirect, or :term:" "`virtual `) of *classinfo*. A class is considered a " @@ -1712,12 +1640,12 @@ msgid "" "entry in *classinfo*. In any other case, a :exc:`TypeError` exception is " "raised." msgstr "" -"如果 *class* 是 *classinfo* 的子類(直接、間接或 :term:`虛擬` 的),則返回 true。*classinfo* 可以是類物件的元組,此時 *classinfo* " -"中的每個元素都會被檢查。其他情況,會觸發 :exc:`TypeError` 異常。" +"如果 *class* 是 *classinfo* 的 subclass(直接、間接或 :term:`virtual " +"`),則回傳 ``True``。\\ *classinfo* 可以是 class 物件" +"的 tuple 或是一個 :ref:`types-union`,此時若 *class* 是 *classinfo* 中任一元" +"素的 subclass 時則回傳 ``True``。其他情況,會觸發 :exc:`TypeError`。" #: ../../library/functions.rst:926 -#, fuzzy msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -1731,17 +1659,16 @@ msgid "" "__next__` method; if the value returned is equal to *sentinel*, :exc:" "`StopIteration` will be raised, otherwise the value will be returned." msgstr "" -"返回一個 :term:`iterator` 物件。根據是否存在第二個實參,第一個實參的解釋是非" -"常不同的。如果沒有第二個實參,*object* 必須是支援迭代協議(有 :meth:" -"`__iter__` 方法)的集合物件,或必須支援序列協議(有 :meth:`__getitem__` 方" -"法,且數字引數從 ``0`` 開始)。如果它不支援這些協議,會觸發 :exc:" -"`TypeError`。如果有第二個實參 *sentinel*,那麼 *object* 必須是可呼叫的物件。" -"這種情況下生成的迭代器,每次迭代呼叫它的 :meth:`~iterator.__next__` 方法時都" -"會不帶實參地呼叫 *object*;如果返回的結果是 *sentinel* 則觸發 :exc:" -"`StopIteration`,否則返回呼叫結果。" +"回傳一個 :term:`iterator` 物件。根據是否存在第二個引數,第一個引數的意義是非" +"常不同的。如果沒有第二個引數,*object* 必須是支援 :term:`iterable` 協定(有 :" +"meth:`__iter__` method)的集合物件,或必須支援序列協定(有 :meth:" +"`__getitem__` 方法,且數字引數從 ``0`` 開始)。如果它不支援這些協定,會觸發 :" +"exc:`TypeError`。如果有第二個引數 *sentinel*,那麼 *object* 必須是可呼叫的物" +"件,這種情況下生成的 iterator,每次疊代呼叫 :meth:`~iterator.__next__` 時會不" +"帶引數地呼叫 *object*\\ ;如果回傳的結果是 *sentinel* 則觸發 :exc:" +"`StopIteration`,否則回傳呼叫結果。" #: ../../library/functions.rst:939 -#, fuzzy msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" @@ -1753,14 +1680,13 @@ msgid "" msgstr "" #: ../../library/functions.rst:953 -#, fuzzy msgid "" "Return the length (the number of items) of an object. The argument may be a " "sequence (such as a string, bytes, tuple, list, or range) or a collection " "(such as a dictionary, set, or frozen set)." msgstr "" -"返回物件的長度(元素個數)。實參可以是序列(如 string、bytes、tuple、list 或 " -"range 等)或集合(如 dictionary、set 或 frozen set 等)。" +"回傳物件的長度(元素個數)。引數可以是序列(如 string、bytes、tuple、list 或 " +"range)或集合(如 dictionary、set 或 frozen set)。" #: ../../library/functions.rst:959 msgid "" @@ -1769,7 +1695,6 @@ msgid "" msgstr "" #: ../../library/functions.rst:967 -#, fuzzy msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -1778,26 +1703,25 @@ msgstr "" "和 :ref:`typesseq`。" #: ../../library/functions.rst:973 -#, fuzzy msgid "" "Update and return a dictionary representing the current local symbol table. " "Free variables are returned by :func:`locals` when it is called in function " "blocks, but not in class blocks. Note that at the module level, :func:" "`locals` and :func:`globals` are the same dictionary." msgstr "" -"更新並返回表示當前本地符號表的字典。在函式塊而不是類塊中呼叫 :func:`locals` " -"時會返回自由變數。" +"更新並回傳表示當前本地符號表的 dictionary。在函式區塊而不是 class 區塊中呼" +"叫 :func:`locals` 時會回傳自由變數。請注意,在 module 階層中,\\ :func:" +"`locals` 和 :func:`globals` 是相同的 dictionary。" #: ../../library/functions.rst:979 -#, fuzzy msgid "" "The contents of this dictionary should not be modified; changes may not " "affect the values of local and free variables used by the interpreter." msgstr "" -"不要更改此字典的內容;更改不會影響直譯器使用的區域性變數或自由變數的值。" +"此 dictionary 的內容不應該被更動;更改可能不會影響直譯器使用的本地變數或自由" +"變數的值。" #: ../../library/functions.rst:984 -#, fuzzy msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterable* arguments are passed, " @@ -1806,31 +1730,28 @@ msgid "" "the shortest iterable is exhausted. For cases where the function inputs are " "already arranged into argument tuples, see :func:`itertools.starmap`\\." msgstr "" -"產生一個將 *function* 應用於迭代器中所有元素並返回結果的迭代器。如果傳遞了額" -"外的 *iterable* 實參,*function* 必須接受相同個數的實參,並使用所有迭代器中並" -"行獲取的元素。當有多個迭代器時,最短的迭代器耗盡則整個迭代結束。如果函式的輸" -"入已經是元組實參,請參閱 :func:`itertools.starmap`。" +"產生一個將 *function* 應用於 *iterable* 中所有元素,並收集回傳結果的 " +"iterator。如果傳遞了額外的 *iterable* 引數,*function* 必須接受相同個數的引" +"數,並應用於所有 iterables 中同時獲取的元素。當有多個 iterables 時,最短的 " +"iteratable 耗盡時 iterator 也會結束。如果函式的輸入已經是 tuple 的引數,請參" +"閱 :func:`itertools.starmap`\\。" #: ../../library/functions.rst:995 -#, fuzzy msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." -msgstr "返回可迭代物件中最大的元素,或者返回兩個及以上實參中最大的。" +msgstr "回傳 iterable 中最大的元素,或者回傳兩個及以上引數中最大的。" #: ../../library/functions.rst:998 -#, fuzzy msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The largest item in the iterable is returned. If two or more positional " "arguments are provided, the largest of the positional arguments is returned." msgstr "" -"如果只提供了一個 positional 實參,它必須是非空 :term:`iterable`,返回可迭代物" -"件中最大的元素;如果提供了兩個及以上的 positional 實參,則返回最大的 " -"positional 實參。" +"如果只提供了一個位置引數,它必須是個 :term:`iterable`,iterable 中最大的元素" +"會被回傳。如果提供了兩個或以上的位置引數,則回傳最大的位置引數。" #: ../../library/functions.rst:1003 ../../library/functions.rst:1040 -#, fuzzy msgid "" "There are two optional keyword-only arguments. The *key* argument specifies " "a one-argument ordering function like that used for :meth:`list.sort`. The " @@ -1838,131 +1759,119 @@ msgid "" "empty. If the iterable is empty and *default* is not provided, a :exc:" "`ValueError` is raised." msgstr "" -"有兩個可選只能用關鍵字的實參。*key* 實參指定排序函式用的引數,如傳給 :meth:" -"`list.sort` 的。*default* 實參是當可迭代物件為空時返回的值。如果可迭代物件為" -"空,並且沒有給 *default* ,則會觸發 :exc:`ValueError`。" +"這個函式有兩個選擇性僅限關鍵字的引數。*key* 引數指定一個只有一個引數的排序函" +"式,如同 :meth:`list.sort` 使用方式。*default* 引數是當 iterable 為空時回傳的" +"值。如果 iterable 為空,並且沒有提供 *default*,則會觸發 :exc:`ValueError`。" #: ../../library/functions.rst:1009 -#, fuzzy msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " "such as ``sorted(iterable, key=keyfunc, reverse=True)[0]`` and ``heapq." "nlargest(1, iterable, key=keyfunc)``." msgstr "" -"如果有多個最大元素,則此函式將返回第一個找到的。這和其他穩定排序工具如 " +"如果有多個最大元素,則此函式將回傳第一個找到的。這和其他穩定排序工具如 " "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " -"iterable, key=keyfunc)`` 保持一致。" +"iterable, key=keyfunc)`` 一致。" #: ../../library/functions.rst:1014 ../../library/functions.rst:1051 -#, fuzzy msgid "The *default* keyword-only argument." -msgstr "keyword-only 實參 *default* 。" +msgstr "*default* 僅限關鍵字引數。" #: ../../library/functions.rst:1017 ../../library/functions.rst:1054 msgid "The *key* can be ``None``." msgstr "" #: ../../library/functions.rst:1025 -#, fuzzy msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." msgstr "" -"返回由給定實參建立的“記憶體檢視”物件。有關詳細資訊,請參閱 :ref:" +"回傳由給定的引數建立之 \"memory view\" 物件。有關詳細資訊,請參閱 :ref:" "`typememoryview`。" #: ../../library/functions.rst:1032 -#, fuzzy msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." -msgstr "返回可迭代物件中最小的元素,或者返回兩個及以上實參中最小的。" +msgstr "回傳 iterable 中最小的元素,或者回傳兩個及以上引數中最小的。" #: ../../library/functions.rst:1035 -#, fuzzy msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The smallest item in the iterable is returned. If two or more positional " "arguments are provided, the smallest of the positional arguments is returned." msgstr "" -"如果只提供了一個 positional 實參,它必須是 :term:`iterable`,返回可迭代物件中" -"最小的元素;如果提供了兩個及以上的 positional 實參,則返回最小的 positional " -"實參。" +"如果只提供了一個位置引數,它必須是 :term:`iterable`,iterable 中最小的元素會" +"被回傳。如果提供了兩個或以上的位置引數,則回傳最小的位置引數。" #: ../../library/functions.rst:1046 -#, fuzzy msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " "such as ``sorted(iterable, key=keyfunc)[0]`` and ``heapq.nsmallest(1, " "iterable, key=keyfunc)``." msgstr "" -"如果有多個最小元素,則此函式將返回第一個找到的。這和其他穩定排序工具如 " +"如果有多個最小元素,則此函式將回傳第一個找到的。這和其他穩定排序工具如 " "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " -"key=keyfunc)`` 保持一致。" +"key=keyfunc)`` 一致。" #: ../../library/functions.rst:1060 -#, fuzzy msgid "" "Retrieve the next item from the :term:`iterator` by calling its :meth:" "`~iterator.__next__` method. If *default* is given, it is returned if the " "iterator is exhausted, otherwise :exc:`StopIteration` is raised." msgstr "" -"通過呼叫 *iterator* 的 :meth:`~iterator.__next__` 方法獲取下一個元素。如果迭" -"代器耗盡,則返回給定的 *default*,如果沒有預設值則觸發 :exc:`StopIteration`。" +"通過呼叫 :term:`iterator` 的 :meth:`~iterator.__next__` method 獲取下一個元" +"素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則觸發 :" +"exc:`StopIteration`。" #: ../../library/functions.rst:1067 -#, fuzzy msgid "" "Return a new featureless object. :class:`object` is a base for all classes. " "It has methods that are common to all instances of Python classes. This " "function does not accept any arguments." msgstr "" -"返回一個沒有特徵的新物件。:class:`object` 是所有類的基類。它具有所有 Python " -"類例項的通用方法。這個函式不接受任何實參。" +"回傳一個沒有特徵的新物件。:class:`object` 是所有 class 的基礎,它具有所有 " +"Python class 實例的通用 method。這個函式不接受任何引數。" #: ../../library/functions.rst:1073 -#, fuzzy msgid "" ":class:`object` does *not* have a :attr:`~object.__dict__`, so you can't " "assign arbitrary attributes to an instance of the :class:`object` class." msgstr "" -"由於 :class:`object` 沒有 :attr:`~object.__dict__`,因此無法將任意屬性賦給 :" -"class:`object` 的例項。" +"由於 :class:`object` *沒有* :attr:`~object.__dict__`,因此無法將任意屬性賦" +"給 :class:`object` class 的實例。" #: ../../library/functions.rst:1079 -#, fuzzy msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " "object, it has to define an :meth:`__index__` method that returns an " "integer. For example:" msgstr "" -"將一個整數轉變為一個字首為“0o”的八進位制字串。結果是一個合法的 Python 表示" -"式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" -"`__index__` 方法返回一個整數。一些例子:" +"將一個整數轉變為一個前綴為 \"0o\" 的八進位制字串。回傳結果是一個有效的 " +"Python 運算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" +"`__index__` method 回傳一個整數。舉例來說:" #: ../../library/functions.rst:1089 -#, fuzzy msgid "" "If you want to convert an integer number to an octal string either with the " "prefix \"0o\" or not, you can use either of the following ways." msgstr "" -"如果要將整數轉換為八進位制字串,並可選擇有無“0o”字首,則可以使用如下方法:" +"如果要將整數轉換為八進位制字串,不論是否具備 \"0o\" 前綴,都可以使用下面的方" +"法。" #: ../../library/functions.rst:1106 -#, fuzzy msgid "" "Open *file* and return a corresponding :term:`file object`. If the file " "cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more " "examples of how to use this function." msgstr "" -"開啟 *file* 並返回對應的 :term:`file object`。如果該檔案不能開啟,則觸發 :" -"exc:`OSError`。" +"開啟 *file* 並回傳對應的 :term:`file object`。如果該檔案不能開啟,則觸發 :" +"exc:`OSError`。關於使用此函式的更多方法請參閱\\ :ref:`tut-files`。" #: ../../library/functions.rst:1110 -#, fuzzy msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the file to be opened or an " @@ -1970,12 +1879,12 @@ msgid "" "given, it is closed when the returned I/O object is closed unless *closefd* " "is set to ``False``.)" msgstr "" -"*file* 是將要開啟的檔案的路徑(絕對路徑或者當前工作目錄的相當路徑),是一個 :" -"term:`path-like object`;也可能是要被封裝的檔案描述符的數字。(如果是檔案描述" -"符,它會隨著返回的 I/O 物件關閉而關閉,除非 *closefd* 是 ``False`` 。)" +"*file* 是一個 :term:`path-like object`,是將被開啟之檔案的路徑(絕對路徑或者" +"當前工作目錄的相當路徑),或是被封裝的整數檔案描述器 (file descriptor)。(如" +"果有提供檔案描述器,它會隨著回傳的 I/O 物件關閉而關閉,除非 *closefd* 被設為 " +"``False``。)" #: ../../library/functions.rst:1116 -#, fuzzy msgid "" "*mode* is an optional string that specifies the mode in which the file is " "opened. It defaults to ``'r'`` which means open for reading in text mode. " @@ -1988,21 +1897,19 @@ msgid "" "encoding. (For reading and writing raw bytes use binary mode and leave " "*encoding* unspecified.) The available modes are:" msgstr "" -"*mode* 是一個可選字串,用於指定開啟檔案的模式。預設值是 ``'r'`` ,這意味著它" -"以文字模式開啟並讀取。其他常見模式有:寫入 ``'w'`` (截斷已經存在的檔案);排" -"它性建立 ``'x'`` ;追加寫 ``'a'`` (在 *一些* Unix 系統上,無論當前的檔案指" -"標在什麼位置,*所有* 寫入都會追加到檔案末尾)。在文字模式,如果 *encoding* 沒" -"有指定,則根據平臺來決定使用的編碼:使用 ``locale." -"getpreferredencoding(False)`` 來獲取本地編碼。(要讀取和寫入原始位元組,請使" -"用二進位制模式並不要指定 *encoding*。)可用的模式有:" +"*mode* 是一個選擇性字串,用於指定開啟檔案的模式。預設值是 ``'r'``,這意味著它" +"以文字模式開啟並讀取。其他常見模式有:寫入 ``'w'``\\ (會捨去已經存在的檔" +"案)、唯一性創建 ``'x'``\\ 、追加寫入 ``'a'``\\ (在\\ *一些* Unix 系統上,無" +"論當前的檔案指標在什麼位置,*所有* 寫入都會追加到檔案末尾)。在文字模式,如果" +"沒有指定 *encoding*,則根據電腦平臺來決定使用的編碼:呼叫 ``locale." +"getpreferredencoding(False)`` 來獲取當前的本地編碼。(要讀取和寫入原始 " +"bytes,請使用二進位制模式且不要指定 *encoding*。)可用的模式有:" #: ../../library/functions.rst:1133 -#, fuzzy msgid "Character" msgstr "字元" #: ../../library/functions.rst:1133 -#, fuzzy msgid "Meaning" msgstr "意義" @@ -2011,7 +1918,6 @@ msgid "``'r'``" msgstr "``'r'``" #: ../../library/functions.rst:1135 -#, fuzzy msgid "open for reading (default)" msgstr "讀取(預設)" @@ -2020,36 +1926,32 @@ msgid "``'w'``" msgstr "``'w'``" #: ../../library/functions.rst:1136 -#, fuzzy msgid "open for writing, truncating the file first" -msgstr "写入,并先截断文件" +msgstr "" #: ../../library/functions.rst:1137 msgid "``'x'``" msgstr "``'x'``" #: ../../library/functions.rst:1137 -#, fuzzy msgid "open for exclusive creation, failing if the file already exists" -msgstr "排它性创建,如果文件已存在则失败" +msgstr "唯一性創建,如果文件已存在則會失敗" #: ../../library/functions.rst:1138 msgid "``'a'``" msgstr "``'a'``" #: ../../library/functions.rst:1138 -#, fuzzy msgid "open for writing, appending to the end of file if it exists" -msgstr "写入,如果文件存在则在末尾追加" +msgstr "寫入,如果文件存在則在末尾追加寫入內容" #: ../../library/functions.rst:1139 msgid "``'b'``" msgstr "``'b'``" #: ../../library/functions.rst:1139 -#, fuzzy msgid "binary mode" -msgstr "二进制模式" +msgstr "二進制模式" #: ../../library/functions.rst:1140 msgid "``'t'``" @@ -2064,19 +1966,17 @@ msgid "``'+'``" msgstr "``'+'``" #: ../../library/functions.rst:1141 -#, fuzzy msgid "open for updating (reading and writing)" -msgstr "更新磁碟檔案(讀取並寫入)" +msgstr "更新(讀取並寫入)" #: ../../library/functions.rst:1144 -#, fuzzy msgid "" "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " "``'r+b'`` open the file with no truncation." msgstr "" -"預設的模式是 ``'r'`` (開啟並讀取文字,同 ``'rt'`` )。對於二進位制寫入, " -"``'w+b'`` 模式開啟並把檔案截斷成 0 位元組; ``'r+b'`` 則不會截斷。" +"預設的模式是 ``'r'``\\ (開啟並讀取文字,同 ``'rt'``)。對於二進位制寫入," +"``'w+b'`` 模式開啟並把檔案內容變成 0 bytes,``'r+b'`` 則不會捨棄原始內容。" #: ../../library/functions.rst:1148 msgid "" @@ -2242,18 +2142,18 @@ msgid "" msgstr "" #: ../../library/functions.rst:1263 -#, fuzzy msgid "The newly created file is :ref:`non-inheritable `." -msgstr "新建立的檔案是 :ref:`不可繼承的 `。" +msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" #: ../../library/functions.rst:1265 -#, fuzzy msgid "" "The following example uses the :ref:`dir_fd ` parameter of the :func:" "`os.open` function to open a file relative to a given directory::" msgstr "" -"下面的示例使用 :func:`os.open` 函式返回值傳給 :ref:`dir_fd ` 的形參," -"從給定的目錄中用相對路徑開啟檔案::" +"下面的範例使用 :func:`os.open` 函式回傳值當作 :ref:`dir_fd ` 的參數," +"從給定的目錄中用相對路徑開啟檔案:\n" +"\n" +"::" #: ../../library/functions.rst:1278 msgid "" @@ -2271,14 +2171,14 @@ msgid "" msgstr "" #: ../../library/functions.rst:1299 -#, fuzzy msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" "`tempfile`, and :mod:`shutil`." msgstr "" -"另請參閱檔案操作模組,例如 :mod:`fileinput`、:mod:`io` (聲明瞭 :func:" -"`open`)、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 和 :mod:`shutil`。" +"另請參閱檔案操作模組,例如 :mod:`fileinput`、:mod:`io`\\ (定義了 :func:" +"`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" +"`shutil`。" #: ../../library/functions.rst:1303 msgid "" @@ -2293,90 +2193,79 @@ msgid "" msgstr "" #: ../../library/functions.rst:1311 -#, fuzzy msgid "The *opener* parameter was added." -msgstr "增加了 *opener* 形參。" +msgstr "增加了 *opener* 參數。" #: ../../library/functions.rst:1312 -#, fuzzy msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" #: ../../library/functions.rst:1313 -#, fuzzy msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去觸發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" #: ../../library/functions.rst:1314 -#, fuzzy msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." msgstr "" -"如果檔案已存在但使用了排它性建立模式( ``'x'`` ),現在會觸發 :exc:" +"如果檔案已存在但使用了唯一性建立模式 (\\ ``'x'``\\ ),現在會觸發 :exc:" "`FileExistsError`。" #: ../../library/functions.rst:1320 -#, fuzzy msgid "The file is now non-inheritable." -msgstr "檔案現在禁止繼承。" +msgstr "檔案在當前版本開始禁止繼承。" #: ../../library/functions.rst:1324 -#, fuzzy msgid "The ``'U'`` mode." msgstr "``'U'`` 模式。" #: ../../library/functions.rst:1329 -#, fuzzy msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" "exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -"如果系統呼叫被中斷,但訊號處理程式沒有觸發異常,此函式現在會重試系統呼叫,而" -"不是觸發 :exc:`InterruptedError` 異常(原因詳見 :pep:`475`)。" +"如果系統呼叫被中斷,但訊號處理程序沒有觸發例外,此函式現在會重試系統呼叫,而" +"不是觸發 :exc:`InterruptedError`\\ (原因詳見 :pep:`475`)。" #: ../../library/functions.rst:1332 -#, fuzzy msgid "The ``'namereplace'`` error handler was added." -msgstr "增加了 ``'namereplace'`` 錯誤處理介面。" +msgstr "增加了 ``'namereplace'`` 錯誤處理程式。" #: ../../library/functions.rst:1337 -#, fuzzy msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對實現了 :class:`os.PathLike` 物件的支援。" #: ../../library/functions.rst:1338 -#, fuzzy msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." msgstr "" -"在 Windows 上,開啟一個控制檯緩衝區將返回 :class:`io.RawIOBase` 的子類,而不" -"是 :class:`io.FileIO`。" +"在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " +"subclass,而不是 :class:`io.FileIO`。" #: ../../library/functions.rst:1343 -#, fuzzy msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " "``ord('a')`` returns the integer ``97`` and ``ord('€')`` (Euro sign) returns " "``8364``. This is the inverse of :func:`chr`." msgstr "" -"對錶示單個 Unicode 字元的字串,返回代表它 Unicode 碼點的整數。例如 " -"``ord('a')`` 返回整數 ``97``, ``ord('€')`` (歐元符合)返回 ``8364`` 。這" +"對於代表單個 Unicode 字元的字串,回傳代表它 Unicode 編碼位置的整數。例如 " +"``ord('a')`` 回傳整數 ``97``、\\ ``ord('€')``\\ (歐元符號)回傳 ``8364``。這" "是 :func:`chr` 的逆函式。" #: ../../library/functions.rst:1351 -#, fuzzy msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " "power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % " "mod``). The two-argument form ``pow(base, exp)`` is equivalent to using the " "power operator: ``base**exp``." msgstr "" -"返回 *x* 的 *y* 次冪;如果 *z* 存在,則對 *z* 取餘(比直接 ``pow(x, y) % z`` " -"計算更高效)。兩個引數形式的 ``pow(x, y)`` 等價於冪運算子: ``x**y``。" +"回傳 *base* 的 *exp* 次方;如果 *mod* 存在,則回傳 *base* 的 *exp* 次方對 " +"*mod* 取餘數(比直接呼叫 ``pow(base, exp) % mod`` 計算更高效)。兩個引數形式" +"的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" #: ../../library/functions.rst:1356 msgid "" @@ -2446,14 +2335,12 @@ msgid "" msgstr "" #: ../../library/functions.rst:1409 -#, fuzzy msgid "Added the *flush* keyword argument." -msgstr "增加了 *flush* keyword 實參。" +msgstr "增加了 *flush* 關鍵字引數。" #: ../../library/functions.rst:1415 -#, fuzzy msgid "Return a property attribute." -msgstr "返回 property 屬性。" +msgstr "回傳 property 屬性。" #: ../../library/functions.rst:1417 msgid "" @@ -2585,7 +2472,6 @@ msgid "" msgstr "" #: ../../library/functions.rst:1561 -#, fuzzy msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string, and an arbitrary value. The string may name an existing attribute " @@ -2593,9 +2479,6 @@ msgid "" "provided the object allows it. For example, ``setattr(x, 'foobar', 123)`` " "is equivalent to ``x.foobar = 123``." msgstr "" -":func:`setattr` 相關的函式。實參是一個物件和一個字串。該字串必須是物件的某個" -"屬性。如果物件允許,該函式將刪除指定的屬性。例如 ``delattr(x, 'foobar')`` 等" -"價於 ``del x.foobar`` 。" #: ../../library/functions.rst:1569 msgid "" @@ -2624,7 +2507,7 @@ msgstr "" #: ../../library/functions.rst:1593 msgid "" "Has two optional arguments which must be specified as keyword arguments." -msgstr "有兩個選擇性參數,只能使用關鍵字參數指定。" +msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" #: ../../library/functions.rst:1595 msgid "" @@ -2681,23 +2564,19 @@ msgid "" msgstr "" #: ../../library/functions.rst:1632 -#, fuzzy msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." msgstr "" -"``@classmethod`` 形式是一個函式 :term:`decorator` - 參見 :ref:`function` 中關" -"於函式定義的詳細介紹。" +"``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" +"的詳細介紹。" #: ../../library/functions.rst:1635 -#, fuzzy msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, they can be called as regular " "functions (such as ``f()``)." msgstr "" -"它可以同時在類(如 ``C.f()``)和例項(如 ``C().f()``)上呼叫。例項除了它的類" -"資訊,其他都會被忽略。如果一個類方法在子類上呼叫,子類會作為第一個實參傳入。" #: ../../library/functions.rst:1639 msgid "" @@ -2716,9 +2595,8 @@ msgid "" msgstr "" #: ../../library/functions.rst:1655 -#, fuzzy msgid "For more information on static methods, see :ref:`types`." -msgstr "關於類方法的更多資訊,請參考文件 :ref:`types` 中的標準型別的層次。" +msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" #: ../../library/functions.rst:1657 msgid "" @@ -2755,9 +2633,8 @@ msgid "" msgstr "" #: ../../library/functions.rst:1690 -#, fuzzy msgid "The *start* parameter can be specified as a keyword argument." -msgstr "有兩個選擇性參數,只能使用關鍵字參數指定。" +msgstr "*start* 參數可被指定為關鍵字引數。" #: ../../library/functions.rst:1695 msgid "" @@ -2888,7 +2765,7 @@ msgstr "" #: ../../library/functions.rst:1798 msgid "See also :ref:`bltin-type-objects`." -msgstr "" +msgstr "另請參閱 :ref:`bltin-type-objects`。" #: ../../library/functions.rst:1800 msgid "" @@ -3038,7 +2915,7 @@ msgstr "" #: ../../library/functions.rst:1911 msgid "Added the ``strict`` argument." -msgstr "增加了 ``strict`` 參數。" +msgstr "增加了 ``strict`` 引數。" #: ../../library/functions.rst:1923 msgid "" @@ -3137,29 +3014,10 @@ msgid "Footnotes" msgstr "註解" #: ../../library/functions.rst:1989 -#, fuzzy msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " "you are reading the code from a file, make sure to use newline conversion " "mode to convert Windows or Mac-style newlines." msgstr "" "剖析器只接受 Unix 風格的行結束符。如果您從檔案中讀取程式碼,請確保用換行符轉" -"換模式轉換Windows 或 Mac 風格的換行符。" - -#, fuzzy -#~ msgid "" -#~ "One useful application of the second form of :func:`iter` is to read " -#~ "lines of a file until a certain line is reached. The following example " -#~ "reads a file until the :meth:`~io.TextIOBase.readline` method returns an " -#~ "empty string::" -#~ msgstr "" -#~ ":func:`iter` 的第二種形式的一個有用的用法是將檔案讀到特定行。在下面的例子" -#~ "中,我們將讀取檔案,直到 :meth:`~io.TextIOBase.readline` 方法返回一個空字" -#~ "串" - -#~ msgid "``'U'``" -#~ msgstr "``'U'``" - -#, fuzzy -#~ msgid ":term:`universal newlines` mode (deprecated)" -#~ msgstr ":term:`universal newlines` 模式(已棄用)" +"換模式轉換 Windows 或 Mac 風格的換行符。" pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy