@@ -3416,6 +3416,8 @@ msgid ""
34163416"specific requests are in section :ref:`Buffer request types <buffer-request-"
34173417"types>`."
34183418msgstr ""
3419+ "*view* 中每个字段的描述参见 :ref:`缓冲区结构体 <buffer-structure>` 一节,导出方对于特定请求应当如何反应参见 "
3420+ ":ref:`缓冲区请求类型 <buffer-request-types>` 一节。"
34193421
34203422#: ../../c-api/typeobj.rst:2260
34213423msgid ""
@@ -3425,18 +3427,22 @@ msgid ""
34253427":c:member:`~Py_buffer.strides`, :c:member:`~Py_buffer.suboffsets` and "
34263428":c:member:`~Py_buffer.internal` are read-only for the consumer."
34273429msgstr ""
3430+ "所有在 :c:type:`Py_buffer` 结构体中被指向的内存都属于导出方并必须保持有效直到不再有任何消费方。 "
3431+ ":c:member:`~Py_buffer.format`, :c:member:`~Py_buffer.shape`, "
3432+ ":c:member:`~Py_buffer.strides`, :c:member:`~Py_buffer.suboffsets` 和 "
3433+ ":c:member:`~Py_buffer.internal` 对于消费方来说是只读的。"
34283434
34293435#: ../../c-api/typeobj.rst:2267
34303436msgid ""
34313437":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes "
34323438"buffer while dealing correctly with all request types."
3433- msgstr ""
3439+ msgstr ":c:func:`PyBuffer_FillInfo` 提供了一种暴露简单字节缓冲区同时正确处理地所有请求类型的简便方式。 "
34343440
34353441#: ../../c-api/typeobj.rst:2270
34363442msgid ""
34373443":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps "
34383444"this function."
3439- msgstr ""
3445+ msgstr ":c:func:`PyObject_GetBuffer` 是针对包装此函数的消费方的接口。 "
34403446
34413447#: ../../c-api/typeobj.rst:2279
34423448msgid ""
@@ -3445,14 +3451,16 @@ msgid ""
34453451"``NULL``. Otherwise, a standard implementation of this function will take "
34463452"these optional steps:"
34473453msgstr ""
3454+ "处理释放缓冲区资源的请求。 如果不需要释放任何资源,则 :c:member:`PyBufferProcs.bf_releasebuffer` 可以为 "
3455+ "``NULL``。 在其他情况下,此函数的标准实现将执行以下的可选步骤:"
34483456
34493457#: ../../c-api/typeobj.rst:2284
34503458msgid "Decrement an internal counter for the number of exports."
3451- msgstr ""
3459+ msgstr "递减用于保存导出次数的内部计数器。 "
34523460
34533461#: ../../c-api/typeobj.rst:2286
34543462msgid "If the counter is ``0``, free all memory associated with *view*."
3455- msgstr ""
3463+ msgstr "如果计数器为 ``0``,则释放所有关联到 *view* 的内存。 "
34563464
34573465#: ../../c-api/typeobj.rst:2288
34583466msgid ""
@@ -3461,6 +3469,8 @@ msgid ""
34613469"constant, while a consumer MAY pass a copy of the original buffer as the "
34623470"*view* argument."
34633471msgstr ""
3472+ "导出方必须使用 :c:member:`~Py_buffer.internal` 字段来记录缓冲区专属的资源。 "
3473+ "该字段将确保恒定,而消费方则可能将原始缓冲区作为 *view* 参数传入。"
34643474
34653475#: ../../c-api/typeobj.rst:2294
34663476msgid ""
@@ -3539,6 +3549,7 @@ msgid ""
35393549"allocate additional memory; that should be done by "
35403550":c:member:`~PyTypeObject.tp_new`."
35413551msgstr ""
3552+ "此函数不应执行任何其他实例初始化操作,即使是分配额外内存也不应执行;那应当由 :c:member:`~PyTypeObject.tp_new` 来完成。"
35423553
35433554#: ../../c-api/typeobj.rst:2383
35443555msgid "See :c:member:`~PyTypeObject.tp_free`."
0 commit comments