Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b1dad8f

Browse files
[po] auto sync
1 parent 35156f6 commit b1dad8f

File tree

9 files changed

+726
-37
lines changed

9 files changed

+726
-37
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "80.57%", "updated_at": "2024-12-20T15:46:40Z"}
1+
{"translation": "80.68%", "updated_at": "2024-12-20T18:48:12Z"}

c-api/object.po

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-11-01 14:52+0000\n"
14+
"POT-Creation-Date: 2024-12-20 14:50+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1616
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -562,6 +562,15 @@ msgstr ""
562562

563563
#: ../../c-api/object.rst:415
564564
msgid ""
565+
"This is equivalent to the Python ``__iter__(self): return self`` method. It "
566+
"is intended for :term:`iterator` types, to be used in the "
567+
":c:member:`PyTypeObject.tp_iter` slot."
568+
msgstr ""
569+
"这等价于 Python ``__iter__(self): return self`` 方法。 它是针对 :term:`iterator` "
570+
"类型设计的,将在 :c:member:`PyTypeObject.tp_iter` 槽位中使用。"
571+
572+
#: ../../c-api/object.rst:421
573+
msgid ""
565574
"This is the equivalent to the Python expression ``aiter(o)``. Takes an "
566575
":class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. "
567576
"This is typically a new iterator but if the argument is an "
@@ -572,11 +581,11 @@ msgstr ""
572581
":class:`AsyncIterator`。通常返回的是一个新迭代器,但如果参数是一个 "
573582
":class:`AsyncIterator`,将返回其自身。如果该对象不能被迭代,会引发 :exc:`TypeError`,并返回 ``NULL``。"
574583

575-
#: ../../c-api/object.rst:425
584+
#: ../../c-api/object.rst:431
576585
msgid "Get a pointer to subclass-specific data reserved for *cls*."
577586
msgstr "获取一个指向为 *cls* 保留的子类专属数据的指针。"
578587

579-
#: ../../c-api/object.rst:427
588+
#: ../../c-api/object.rst:433
580589
msgid ""
581590
"The object *o* must be an instance of *cls*, and *cls* must have been "
582591
"created using negative :c:member:`PyType_Spec.basicsize`. Python does not "
@@ -585,17 +594,17 @@ msgstr ""
585594
"对象 *o* 必须为 *cls* 的实例,而 *cls* 必须使用负的 :c:member:`PyType_Spec.basicsize` 来创建。 "
586595
"Python 不会检查这一点。"
587596

588-
#: ../../c-api/object.rst:431
597+
#: ../../c-api/object.rst:437
589598
msgid "On error, set an exception and return ``NULL``."
590599
msgstr "发生错误时,将设置异常并返回 ``NULL``。"
591600

592-
#: ../../c-api/object.rst:437
601+
#: ../../c-api/object.rst:443
593602
msgid ""
594603
"Return the size of the instance memory space reserved for *cls*, i.e. the "
595604
"size of the memory :c:func:`PyObject_GetTypeData` returns."
596605
msgstr "返回为 *cls* 保留的实例内存空间大小,即 :c:func:`PyObject_GetTypeData` 所返回的内存大小。"
597606

598-
#: ../../c-api/object.rst:440
607+
#: ../../c-api/object.rst:446
599608
msgid ""
600609
"This may be larger than requested using :c:member:`-PyType_Spec.basicsize "
601610
"<PyType_Spec.basicsize>`; it is safe to use this larger size (e.g. with "
@@ -604,24 +613,24 @@ msgstr ""
604613
"这可能会大于使用 :c:member:`-PyType_Spec.basicsize <PyType_Spec.basicsize>` "
605614
"请求到的大小;可以安全地使用这个更大的值 (例如通过 :c:func:`!memset`)。"
606615

607-
#: ../../c-api/object.rst:443
616+
#: ../../c-api/object.rst:449
608617
msgid ""
609618
"The type *cls* **must** have been created using negative "
610619
":c:member:`PyType_Spec.basicsize`. Python does not check this."
611620
msgstr ""
612621
"类型 *cls* **必须** 使用负的 :c:member:`PyType_Spec.basicsize` 来创建。 Python 不会检查这一点。"
613622

614-
#: ../../c-api/object.rst:447
623+
#: ../../c-api/object.rst:453
615624
msgid "On error, set an exception and return a negative value."
616625
msgstr "当失败时,将设置异常并返回一个负值。"
617626

618-
#: ../../c-api/object.rst:453
627+
#: ../../c-api/object.rst:459
619628
msgid ""
620629
"Get a pointer to per-item data for a class with "
621630
":c:macro:`Py_TPFLAGS_ITEMS_AT_END`."
622631
msgstr "使用 :c:macro:`Py_TPFLAGS_ITEMS_AT_END` 获取一个指向类的单独条目数据的指针。"
623632

624-
#: ../../c-api/object.rst:456
633+
#: ../../c-api/object.rst:462
625634
msgid ""
626635
"On error, set an exception and return ``NULL``. :py:exc:`TypeError` is "
627636
"raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set."

library/ctypes.po

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ msgid ""
1313
msgstr ""
1414
"Project-Id-Version: Python 3.12\n"
1515
"Report-Msgid-Bugs-To: \n"
16-
"POT-Creation-Date: 2024-11-29 14:50+0000\n"
16+
"POT-Creation-Date: 2024-12-20 14:50+0000\n"
1717
"PO-Revision-Date: 2024-05-11 00:33+0000\n"
1818
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1919
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -875,7 +875,7 @@ msgstr ""
875875
msgid ""
876876
"On those platforms it is required to specify the :attr:`~_CFuncPtr.argtypes`"
877877
" attribute for the regular, non-variadic, function arguments:"
878-
msgstr ""
878+
msgstr "在这些平台上要求为常规、非可变函数参数指定 :attr:`~_CFuncPtr.argtypes` 属性:"
879879

880880
#: ../../library/ctypes.rst:389
881881
msgid "libc.printf.argtypes = [ctypes.c_char_p]"
@@ -885,7 +885,7 @@ msgstr "libc.printf.argtypes = [ctypes.c_char_p]"
885885
msgid ""
886886
"Because specifying the attribute does not inhibit portability it is advised "
887887
"to always specify :attr:`~_CFuncPtr.argtypes` for all variadic functions."
888-
msgstr ""
888+
msgstr "因为指定该属性不会影响可移植性所以建议总是为所有可变函数指定 :attr:`~_CFuncPtr.argtypes`。"
889889

890890
#: ../../library/ctypes.rst:400
891891
msgid "Calling functions with your own custom data types"
@@ -942,7 +942,7 @@ msgstr "指定必选参数的类型(函数原型)"
942942
msgid ""
943943
"It is possible to specify the required argument types of functions exported "
944944
"from DLLs by setting the :attr:`~_CFuncPtr.argtypes` attribute."
945-
msgstr ""
945+
msgstr "可以通过设置 :attr:`~_CFuncPtr.argtypes` 属性来指定从 DLL 导出函数的必选参数类型。"
946946

947947
#: ../../library/ctypes.rst:431
948948
msgid ""
@@ -952,6 +952,8 @@ msgid ""
952952
"format string, on the other hand this is quite handy to experiment with this"
953953
" feature)::"
954954
msgstr ""
955+
":attr:`~_CFuncPtr.argtypes` 必须是一个 C 数据类型的序列(这里 :func:`!printf` "
956+
"函数可能不是一个好例子,因为它会根据格式字符串的不同接受可变数量和不同类型的形参,但另一方面这对尝试此功能来说也很方便)::"
955957

956958
#: ../../library/ctypes.rst:436
957959
msgid ""
@@ -999,6 +1001,11 @@ msgid ""
9991001
"string, bytes, a :mod:`ctypes` instance, or an object with an "
10001002
":attr:`!_as_parameter_` attribute."
10011003
msgstr ""
1004+
"如果你定义了自己的类并将其传递给函数调用,则你必须为它们实现 :meth:`~_CData.from_param` 类方法才能够在 "
1005+
":attr:`~_CFuncPtr.argtypes` 序列中使用它们。 :meth:`~_CData.from_param` "
1006+
"类方法接受传递给函数调用的 Python 对象,它应该进行类型检查或者其他必要的操作以确保这个对象是可接受的,然后返回对象本身、它的 "
1007+
":attr:`!_as_parameter_` 属性,或在此情况下作为 C 函数参数传入的任何东西。 "
1008+
"同样,结果应该是整数、字符串、字节串、:mod:`ctypes` 实例或是具有 :attr:`!_as_parameter_` 属性的对象。"
10021009

10031010
#: ../../library/ctypes.rst:468
10041011
msgid "Return types"
@@ -1010,6 +1017,8 @@ msgid ""
10101017
"return types can be specified by setting the :attr:`~_CFuncPtr.restype` "
10111018
"attribute of the function object."
10121019
msgstr ""
1020+
"在默认情况下都会假定函数返回 C :c:expr:`int` 类型。 其他返回类型可通过设置函数对象的 setting the "
1021+
":attr:`~_CFuncPtr.restype` 属性来指定。"
10131022

10141023
#: ../../library/ctypes.rst:482
10151024
msgid ""
@@ -1081,6 +1090,8 @@ msgid ""
10811090
"the :attr:`~_CFuncPtr.argtypes` attribute, and the second argument will be "
10821091
"converted from a single character Python bytes object into a C char:"
10831092
msgstr ""
1093+
"如果你想要避免上面的 :func:`ord(\"x\") <ord>` 调用,你可以设置 :attr:`~_CFuncPtr.argtypes` "
1094+
"属性,第二个参数将从单字符 Python 字节串对象转换为 C char:"
10841095

10851096
#: ../../library/ctypes.rst:514
10861097
msgid ""
@@ -1119,6 +1130,8 @@ msgid ""
11191130
"result of your function call. This is useful to check for error return "
11201131
"values and automatically raise an exception::"
11211132
msgstr ""
1133+
"如果外部函数返回一个整数,你也可以使用一个 Python 可调用对象(例如函数或类)作为 :attr:`~_CFuncPtr.restype` 属性。 "
1134+
"该可调用对象被调用时将附带 C 函数返回的 *整数*,其调用结果将被用作函数调用的结果值。 这对于检查错误返回值并自动引发异常来说很有用处::"
11221135

11231136
#: ../../library/ctypes.rst:535
11241137
msgid ""
@@ -1171,7 +1184,7 @@ msgid ""
11711184
"Please note that a much more powerful error checking mechanism is available "
11721185
"through the :attr:`~_CFuncPtr.errcheck` attribute; see the reference manual "
11731186
"for details."
1174-
msgstr ""
1187+
msgstr "请注意通过 :attr:`~_CFuncPtr.errcheck` 属性可提供更强大的错误检查机制;详情见参考手册。"
11751188

11761189
#: ../../library/ctypes.rst:565
11771190
msgid "Passing pointers (or: passing parameters by reference)"
@@ -4241,7 +4254,7 @@ msgstr ""
42414254
msgid ""
42424255
"Represents a :c:type:`!HRESULT` value, which contains success or error "
42434256
"information for a function or method call."
4244-
msgstr ""
4257+
msgstr "代表一个 :c:type:`!HRESULT` 值,它包含某个函数或方法调用的成功或错误信息。"
42454258

42464259
#: ../../library/ctypes.rst:2478
42474260
msgid ""

0 commit comments

Comments
 (0)