# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Liang-Bo Wang , 2015 # Matt Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2023-07-01 04:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.3.2\n" #: ../../c-api/objbuffer.rst:4 msgid "Old Buffer Protocol" msgstr "舊式緩衝協定 (Buffer Protocol)" #: ../../c-api/objbuffer.rst:8 msgid "" "These functions were part of the \"old buffer protocol\" API in Python 2. In " "Python 3, this protocol doesn't exist anymore but the functions are still " "exposed to ease porting 2.x code. They act as a compatibility wrapper " "around the :ref:`new buffer protocol `, but they don't give " "you control over the lifetime of the resources acquired when a buffer is " "exported." msgstr "" "這些函式是 Python 2 中「舊式緩衝區協定」API 的一部分。在 Python 3 中,該協議" "已經不存在,但這些函式仍有公開以供移植 2.x 程式碼。它們充當\\ :ref:`新式緩衝" "區協定 `\\ 的相容性包裝器,但它們無法讓你控制匯出 (export) 緩" "衝區時所獲取資源的生命週期。" #: ../../c-api/objbuffer.rst:15 msgid "" "Therefore, it is recommended that you call :c:func:`PyObject_GetBuffer` (or " "the ``y*`` or ``w*`` :ref:`format codes ` with the :c:func:" "`PyArg_ParseTuple` family of functions) to get a buffer view over an object, " "and :c:func:`PyBuffer_Release` when the buffer view can be released." msgstr "" "因此,建議你呼叫 :c:func:`PyObject_GetBuffer` (或是以 ``y*`` 或 ``w*`` :ref:" "`格式碼 (format code) ` 呼叫 :c:func:`PyArg_ParseTuple` 系列函" "式)獲取物件的緩衝區視圖 (buffer view),以及緩衝區視圖可被釋放時呼叫 :c:func:" "`PyBuffer_Release` 。" #: ../../c-api/objbuffer.rst:23 msgid "" "Returns a pointer to a read-only memory location usable as character-based " "input. The *obj* argument must support the single-segment character buffer " "interface. On success, returns ``0``, sets *buffer* to the memory location " "and *buffer_len* to the buffer length. Returns ``-1`` and sets a :exc:" "`TypeError` on error." msgstr "" "回傳一個指向可用作基於字元輸入之唯讀記憶體位置的指標。 *obj* 引數必須支援單一" "片段 (single-segment) 字元緩衝區介面。成功時回傳 ``0``,並將 *buffer* 設定為" "記憶體位置、將 *buffer_len* 設定為緩衝區長度。回傳 ``-1`` 並在錯誤時設定 :" "exc:`TypeError`。" #: ../../c-api/objbuffer.rst:32 msgid "" "Returns a pointer to a read-only memory location containing arbitrary data. " "The *obj* argument must support the single-segment readable buffer " "interface. On success, returns ``0``, sets *buffer* to the memory location " "and *buffer_len* to the buffer length. Returns ``-1`` and sets a :exc:" "`TypeError` on error." msgstr "" "回傳一個指向包含任意資料之唯讀記憶體位置的指標。*obj* 引數必須支援單一片段可" "讀緩衝區介面。成功時回傳 ``0``,並將 *buffer* 設定為記憶體位置、將 " "*buffer_len* 設定為緩衝區長度。回傳 ``-1`` 並在錯誤時設定 :exc:`TypeError`。" #: ../../c-api/objbuffer.rst:41 msgid "" "Returns ``1`` if *o* supports the single-segment readable buffer interface. " "Otherwise returns ``0``. This function always succeeds." msgstr "" "如果 *o* 支援單一片段可讀緩衝區介面,則回傳 ``1``,否則回傳 ``0``。這個函式一" "定會執行成功的。" #: ../../c-api/objbuffer.rst:44 msgid "" "Note that this function tries to get and release a buffer, and exceptions " "which occur while calling corresponding functions will get suppressed. To " "get error reporting use :c:func:`PyObject_GetBuffer()` instead." msgstr "" "請注意,該函式嘗試獲取和釋放緩衝區,並且呼叫相應函式時發生的例外將被抑制。要" "獲取錯誤報告,請改用 :c:func:`PyObject_GetBuffer()`。" #: ../../c-api/objbuffer.rst:51 msgid "" "Returns a pointer to a writable memory location. The *obj* argument must " "support the single-segment, character buffer interface. On success, returns " "``0``, sets *buffer* to the memory location and *buffer_len* to the buffer " "length. Returns ``-1`` and sets a :exc:`TypeError` on error." msgstr "" "回傳指向可寫記憶體位置的指標。 *obj* 引數必須支援單一片段字元緩衝區介面。成功" "時回傳 ``0``,並將 *buffer* 設定為記憶體位置,且將 *buffer_len* 設定為緩衝區" "長度。回傳 ``-1`` 並在錯誤時設定 :exc:`TypeError`。"