@@ -14,7 +14,7 @@ msgid ""
1414msgstr ""
1515"Project-Id-Version : Python 3.14\n "
1616"Report-Msgid-Bugs-To : \n "
17- "POT-Creation-Date : 2026-02-17 14:41 +0000\n "
17+ "POT-Creation-Date : 2026-02-21 14:20 +0000\n "
1818"PO-Revision-Date : 2025-09-16 00:01+0000\n "
1919"Last-Translator : Adorilson Bezerra <adorilson@gmail.com>, 2026\n "
2020"Language-Team : Portuguese (Brazil) (https://app.transifex.com/python-doc/ "
@@ -470,6 +470,7 @@ msgstr "Tipos de dados fundamentais"
470470#: ../../library/ctypes.rst:216
471471msgid ":mod:`!ctypes` defines a number of primitive C compatible data types:"
472472msgstr ""
473+ ":mod:`!ctypes` define vários tipos de dados primitivos compatíveis com C:"
473474
474475#: ../../library/ctypes.rst:219 ../../library/ctypes.rst:291
475476msgid "ctypes type"
@@ -1005,13 +1006,33 @@ msgid ""
10051006"parameter 2\n"
10061007">>>"
10071008msgstr ""
1009+ ">>> printf = libc.printf\n"
1010+ ">>> printf(b\" Hello, %s\\ n\" , b\" World!\" )\n"
1011+ "Hello, World!\n"
1012+ "14\n"
1013+ ">>> printf(b\" Hello, %S\\ n\" , \" World!\" )\n"
1014+ "Hello, World!\n"
1015+ "14\n"
1016+ ">>> printf(b\" %d bottles of beer\\ n\" , 42)\n"
1017+ "42 bottles of beer\n"
1018+ "19\n"
1019+ ">>> printf(b\" %f bottles of beer\\ n\" , 42.5)\n"
1020+ "Traceback (most recent call last):\n"
1021+ " File \" <stdin>\" , line 1, in <module>\n"
1022+ "ctypes.ArgumentError: argument 2: TypeError: Don't know how to convert "
1023+ "parameter 2\n"
1024+ ">>>"
10081025
10091026#: ../../library/ctypes.rst:399
10101027msgid ""
10111028"As has been mentioned before, all Python types except integers, strings, and "
10121029"bytes objects have to be wrapped in their corresponding :mod:`!ctypes` type, "
10131030"so that they can be converted to the required C data type::"
10141031msgstr ""
1032+ "Como mencionado anteriormente, todos os tipos Python, exceto inteiros, "
1033+ "strings e objetos bytes, devem ser encapsulados no seu tipo :mod:`!ctypes` "
1034+ "correspondente, para que possam ser convertidos para o tipo de dados C "
1035+ "necessário::"
10151036
10161037#: ../../library/ctypes.rst:403
10171038msgid ""
@@ -1020,6 +1041,10 @@ msgid ""
10201041"31\n"
10211042">>>"
10221043msgstr ""
1044+ ">>> printf(b\" An int %d, a double %f\\ n\" , 1234, c_double(3.14))\n"
1045+ "An int 1234, a double 3.140000\n"
1046+ "31\n"
1047+ ">>>"
10231048
10241049#: ../../library/ctypes.rst:411
10251050msgid "Calling variadic functions"
@@ -1033,23 +1058,23 @@ msgid ""
10331058"convention for variadic functions is different than that for regular "
10341059"functions."
10351060msgstr ""
1036- "Em muitas plataformas chamar funções variádicas por meio do ctypes é "
1061+ "Em muitas plataformas, chamar funções variádicas por meio do ctypes é "
10371062"exatamente o mesmo que chamar funções com um número fixo de parâmetros. Em "
10381063"algumas plataformas, em particular no ARM64 para plataformas Apple, a "
1039- "convenção de chamada para funções variádicas é diferente daquela usada para "
1040- "funções regulares."
1064+ "convenção de chamada para funções variádicas difere da usada para funções "
1065+ "regulares."
10411066
10421067#: ../../library/ctypes.rst:418
10431068msgid ""
10441069"On those platforms it is required to specify the :attr:`~_CFuncPtr.argtypes` "
10451070"attribute for the regular, non-variadic, function arguments:"
10461071msgstr ""
10471072"Nessas plataformas é necessário especificar o atributo :attr:`~_CFuncPtr."
1048- "argtypes` para os argumentos de função regulares (não variádicos ):"
1073+ "argtypes` para os argumentos de funções regulares (não variádicas ):"
10491074
10501075#: ../../library/ctypes.rst:421
10511076msgid "libc.printf.argtypes = [ctypes.c_char_p]"
1052- msgstr ""
1077+ msgstr "libc.printf.argtypes = [ctypes.c_char_p] "
10531078
10541079#: ../../library/ctypes.rst:425
10551080msgid ""
@@ -1072,6 +1097,12 @@ msgid ""
10721097"The attribute must be an integer, string, bytes, a :mod:`!ctypes` instance, "
10731098"or an object with an :attr:`!_as_parameter_` attribute::"
10741099msgstr ""
1100+ "Você também pode personalizar a conversão de argumentos :mod:`!ctypes` para "
1101+ "permitir que instâncias de suas próprias classes sejam usadas como "
1102+ "argumentos de função. :mod:`!ctypes` procura o atributo :attr:`!"
1103+ "_as_parameter_` e o usa como argumento de função. O atributo deve ser um "
1104+ "inteiro, string, bytes, uma instância :mod:`!ctypes` ou um objeto com um "
1105+ "atributo :attr:`!_as_parameter_`::"
10751106
10761107#: ../../library/ctypes.rst:440
10771108msgid ""
@@ -1085,6 +1116,15 @@ msgid ""
10851116"19\n"
10861117">>>"
10871118msgstr ""
1119+ ">>> class Bottles:\n"
1120+ "... def __init__(self, number):\n"
1121+ "... self._as_parameter_ = number\n"
1122+ "...\n"
1123+ ">>> bottles = Bottles(42)\n"
1124+ ">>> printf(b\" %d bottles of beer\\ n\" , bottles)\n"
1125+ "42 bottles of beer\n"
1126+ "19\n"
1127+ ">>>"
10881128
10891129#: ../../library/ctypes.rst:450
10901130msgid ""
@@ -4404,10 +4444,12 @@ msgid ""
44044444"Represents the C :c:expr:`PyObject *` datatype. Calling this without an "
44054445"argument creates a ``NULL`` :c:expr:`PyObject *` pointer."
44064446msgstr ""
4447+ "Representa o tipo de dados C :c:expr:`PyObject *`. Chamar isto sem um "
4448+ "argumento cria um ponteiro ``NULL`` :c:expr:`PyObject *`."
44074449
44084450#: ../../library/ctypes.rst:2701
44094451msgid ":class:`!py_object` is now a :term:`generic type`."
4410- msgstr ""
4452+ msgstr ":class:`!py_object` é agora um :term:`tipo genérico`. "
44114453
44124454#: ../../library/ctypes.rst:2704
44134455msgid ""
@@ -4416,6 +4458,10 @@ msgid ""
44164458"type:`!DWORD`. Some useful structures like :c:type:`!MSG` or :c:type:`!RECT` "
44174459"are also defined."
44184460msgstr ""
4461+ "O módulo :mod:`!ctypes.wintypes` fornece vários outros tipos de dados "
4462+ "específicos do Windows, por exemplo :c:type:`!HWND`, :c:type:`!WPARAM` ou :c:"
4463+ "type:`!DWORD`. Algumas estruturas úteis como :c:type:`!MSG` ou :c:type:`!"
4464+ "RECT` também estão definidas."
44194465
44204466#: ../../library/ctypes.rst:2712
44214467msgid "Structured data types"
0 commit comments