@@ -1682,18 +1682,20 @@ msgstr ""
16821682msgid ""
16831683"Raises an :ref:`auditing event <auditing>` ``ctypes.dlsym/handle`` with "
16841684"arguments ``handle``, ``name``."
1685- msgstr ""
1685+ msgstr "引发一个审计事件 ``ctypes.dlsym/handle``,附带参数 ``handle``, ``name``。 "
16861686
16871687#: ../../library/ctypes.rst:1524
16881688msgid ""
16891689"In cases when only the library handle is available rather than the object, "
16901690"accessing a function raises an auditing event ``ctypes.dlsym/handle`` with "
16911691"arguments ``handle`` (the raw library handle) and ``name``."
16921692msgstr ""
1693+ "在只有库句柄而非对象可用的情况下,访问函数会引发一个审计事件 ``ctypes.dlsym/handle`` 并附带参数 ``handle`` "
1694+ "(原始库句柄) 和 ``name``。"
16931695
16941696#: ../../library/ctypes.rst:1531
16951697msgid "Foreign functions"
1696- msgstr ""
1698+ msgstr "外部函数 "
16971699
16981700#: ../../library/ctypes.rst:1533
16991701msgid ""
@@ -1703,28 +1705,31 @@ msgid ""
17031705"instances as arguments, and return the default result type specified by the "
17041706"library loader. They are instances of a private class:"
17051707msgstr ""
1708+ "正如之前小节的说明,外部函数可作为被加载共享库的属性来访问。 用此方式创建的函数对象默认接受任意数量的参数,接受任意 ctypes "
1709+ "数据实例作为参数,并且返回库加载器所指定的默认结果类型。 它们是一个私有类的实例:"
17061710
17071711#: ../../library/ctypes.rst:1542
17081712msgid "Base class for C callable foreign functions."
1709- msgstr ""
1713+ msgstr "C 可调用外部函数的基类。 "
17101714
17111715#: ../../library/ctypes.rst:1544
17121716msgid ""
17131717"Instances of foreign functions are also C compatible data types; they "
17141718"represent C function pointers."
1715- msgstr ""
1719+ msgstr "外部函数的实例也是兼容 C 的数据类型;它们代表 C 函数指针。 "
17161720
17171721#: ../../library/ctypes.rst:1547
17181722msgid ""
17191723"This behavior can be customized by assigning to special attributes of the "
17201724"foreign function object."
1721- msgstr ""
1725+ msgstr "此行为可通过对外部函数对象的特殊属性赋值来自定义。 "
17221726
17231727#: ../../library/ctypes.rst:1552
17241728msgid ""
17251729"Assign a ctypes type to specify the result type of the foreign function. Use"
17261730" ``None`` for :c:type:`void`, a function not returning anything."
17271731msgstr ""
1732+ "赋值为一个 ctypes 类型来指定外部函数的结果类型。 使用 ``None`` 表示 :c:type:`void`,即不返回任何结果的函数。"
17281733
17291734#: ../../library/ctypes.rst:1555
17301735msgid ""
@@ -1735,6 +1740,9 @@ msgid ""
17351740" or error checking use a ctypes data type as :attr:`restype` and assign a "
17361741"callable to the :attr:`errcheck` attribute."
17371742msgstr ""
1743+ "赋值为一个不为 ctypes 类型的可调用 Python 对象也是可以的,在此情况下函数应返回 C "
1744+ ":c:type:`int`,该可调用对象将附带此整数被调用,以允许进一步的处理或错误检测。 这种用法已被弃用,为了更灵活的后续处理或错误检测请使用一个 "
1745+ "ctypes 数据类型作为 :attr:`restype` 并将 :attr:`errcheck` 属性赋值为一个可调用对象。"
17381746
17391747#: ../../library/ctypes.rst:1564
17401748msgid ""
@@ -1744,6 +1752,8 @@ msgid ""
17441752"tuple; functions using the C calling convention accept additional, "
17451753"unspecified arguments as well."
17461754msgstr ""
1755+ "赋值为一个 ctypes 类型的元组来指定函数所接受的参数类型。 使用 ``stdcall`` "
1756+ "调用规范的函数只能附带与此元组长度相同数量的参数进行调用;使用 C 调用规范的函数还可接受额外的未指明参数。"
17471757
17481758#: ../../library/ctypes.rst:1570
17491759msgid ""
0 commit comments