@@ -58,6 +58,10 @@ msgid ""
5858"is to guarantee consistent behavior in corner cases, which the Standard C "
5959"functions do not."
6060msgstr ""
61+ ":c:func:`PyOS_snprintf` e :c:func:`PyOS_vsnprintf` envolvem as funções :c:"
62+ "func:`snprintf` e :c:func:`vsnprintf` da biblioteca Standard C. Seu objetivo "
63+ "é garantir um comportamento consistente em casos extremos, o que as funções "
64+ "do Standard C não garantem."
6165
6266#: ../../c-api/conversion.rst:28
6367msgid ""
@@ -66,45 +70,65 @@ msgid ""
6670"into str. Both functions require that ``str != NULL``, ``size > 0`` and "
6771"``format != NULL``."
6872msgstr ""
73+ "Os invólucros garantem que *str*[*size*-1] seja sempre ``'\\ 0'`` no retorno. "
74+ "Eles nunca escrevem mais do que *size* bytes (incluindo o ``'\\ 0'`` ao "
75+ "final) em str. Ambas as funções exigem que ``str != NULL``, ``size > 0`` e "
76+ "``format != NULL``."
6977
7078#: ../../c-api/conversion.rst:33
7179msgid ""
7280"If the platform doesn't have :c:func:`vsnprintf` and the buffer size needed "
7381"to avoid truncation exceeds *size* by more than 512 bytes, Python aborts "
7482"with a :c:func:`Py_FatalError`."
7583msgstr ""
84+ "Se a plataforma não tiver :c:func:`vsnprintf` e o tamanho do buffer "
85+ "necessário para evitar o truncamento exceder *size* em mais de 512 bytes, o "
86+ "Python aborta com um :c:func:`Py_FatalError`."
7687
7788#: ../../c-api/conversion.rst:37
7889msgid ""
7990"The return value (*rv*) for these functions should be interpreted as follows:"
8091msgstr ""
92+ "O valor de retorno (*rv*) para essas funções deve ser interpretado da "
93+ "seguinte forma:"
8194
8295#: ../../c-api/conversion.rst:39
8396msgid ""
8497"When ``0 <= rv < size``, the output conversion was successful and *rv* "
8598"characters were written to *str* (excluding the trailing ``'\\ 0'`` byte at "
8699"*str*[*rv*])."
87100msgstr ""
101+ "Quando``0 <= rv < size``, a conversão de saída foi bem-sucedida e os "
102+ "caracteres de *rv* foram escritos em *str* (excluindo o ``'\\ 0'`` byte em "
103+ "*str*[*rv*])."
88104
89105#: ../../c-api/conversion.rst:43
90106msgid ""
91107"When ``rv >= size``, the output conversion was truncated and a buffer with "
92108"``rv + 1`` bytes would have been needed to succeed. *str*[*size*-1] is "
93109"``'\\ 0'`` in this case."
94110msgstr ""
111+ "Quando ``rv >= size``, a conversão de saída foi truncada e um buffer com "
112+ "``rv + 1`` bytes teria sido necessário para ter sucesso. *str*[*size*-1] é "
113+ "``'\\ 0'`` neste caso."
95114
96115#: ../../c-api/conversion.rst:47
97116msgid ""
98117"When ``rv < 0``, \" something bad happened.\" *str*[*size*-1] is ``'\\ 0'`` in "
99118"this case too, but the rest of *str* is undefined. The exact cause of the "
100119"error depends on the underlying platform."
101120msgstr ""
121+ "Quando ``rv < 0``, \" aconteceu algo de errado.\" *str*[*size*-1] é ``'\\ 0'`` "
122+ "neste caso também, mas o resto de *str* é indefinido. A causa exata do erro "
123+ "depende da plataforma subjacente."
102124
103125#: ../../c-api/conversion.rst:51
104126msgid ""
105127"The following functions provide locale-independent string to number "
106128"conversions."
107129msgstr ""
130+ "As funções a seguir fornecem strings independentes de localidade para "
131+ "conversões de números."
108132
109133#: ../../c-api/conversion.rst:56
110134msgid ""
@@ -114,13 +138,21 @@ msgid ""
114138"have leading or trailing whitespace. The conversion is independent of the "
115139"current locale."
116140msgstr ""
141+ "Converte uma string ``s`` em :c:type:`double`, levantando uma exceção Python "
142+ "em caso de falha. O conjunto de strings aceitas corresponde ao conjunto de "
143+ "strings aceito pelo construtor :func:`float` do Python, exceto que ``s`` não "
144+ "deve ter espaços em branco à esquerda ou à direita. A conversão é "
145+ "independente da localidade atual."
117146
118147#: ../../c-api/conversion.rst:62
119148msgid ""
120149"If ``endptr`` is ``NULL``, convert the whole string. Raise :exc:"
121150"`ValueError` and return ``-1.0`` if the string is not a valid representation "
122151"of a floating-point number."
123152msgstr ""
153+ "Se ``endptr`` for ``NULL``, converte a string inteira. Levanta :exc:"
154+ "`ValueError` e retorna ``-1.0`` se a string não for uma representação válida "
155+ "de um número de ponto flutuante."
124156
125157#: ../../c-api/conversion.rst:66
126158msgid ""
@@ -130,6 +162,11 @@ msgid ""
130162"number, set ``*endptr`` to point to the beginning of the string, raise "
131163"ValueError, and return ``-1.0``."
132164msgstr ""
165+ "Se endptr não for ``NULL``, converte o máximo possível da string e defina "
166+ "``*endptr`` para apontar para o primeiro caractere não convertido. Se nenhum "
167+ "segmento inicial da string for a representação válida de um número de ponto "
168+ "flutuante, define ``*endptr`` para apontar para o início da string, levanta "
169+ "ValueError e retorne ``-1.0``."
133170
134171#: ../../c-api/conversion.rst:73
135172msgid ""
@@ -141,49 +178,73 @@ msgid ""
141178"exception and return ``-1.0``. In both cases, set ``*endptr`` to point to "
142179"the first character after the converted value."
143180msgstr ""
181+ "Se ``s`` representa um valor que é muito grande para armazenar em um ponto "
182+ "flutuante (por exemplo, ``\" 1e500\" `` é uma string assim em muitas "
183+ "plataformas), então se ``overflow_exception`` for ``NULL`` retorna "
184+ "``Py_HUGE_VAL`` (com um sinal apropriado) e não define nenhuma exceção. Caso "
185+ "contrário, ``overflow_exception`` deve apontar para um objeto de exceção "
186+ "Python; levantar essa exceção e retornar ``-1.0``. Em ambos os casos, define "
187+ "``*endptr`` para apontar para o primeiro caractere após o valor convertido."
144188
145189#: ../../c-api/conversion.rst:81
146190msgid ""
147191"If any other error occurs during the conversion (for example an out-of-"
148192"memory error), set the appropriate Python exception and return ``-1.0``."
149193msgstr ""
194+ "Se qualquer outro erro ocorrer durante a conversão (por exemplo, um erro de "
195+ "falta de memória), define a exceção Python apropriada e retorna ``-1.0``."
150196
151197#: ../../c-api/conversion.rst:90
152198msgid ""
153199"Convert a :c:type:`double` *val* to a string using supplied *format_code*, "
154200"*precision*, and *flags*."
155201msgstr ""
202+ "Converte um :c:type:`double` *val* para uma string usando *format_code*, "
203+ "*precision* e *flags* fornecidos."
156204
157205#: ../../c-api/conversion.rst:93
158206msgid ""
159207"*format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, "
160208"``'G'`` or ``'r'``. For ``'r'``, the supplied *precision* must be 0 and is "
161209"ignored. The ``'r'`` format code specifies the standard :func:`repr` format."
162210msgstr ""
211+ "*format_code* deve ser um entre ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, "
212+ "``'G'`` ou ``'r'``. Para ``'r'``, a precisão *precision* fornecida deve ser "
213+ "0 e é ignorada. O código de formato ``'r'`` especifica o formato padrão de :"
214+ "func:`repr`."
163215
164216#: ../../c-api/conversion.rst:98
165217msgid ""
166218"*flags* can be zero or more of the values ``Py_DTSF_SIGN``, "
167219"``Py_DTSF_ADD_DOT_0``, or ``Py_DTSF_ALT``, or-ed together:"
168220msgstr ""
221+ "*flags* pode ser zero ou mais de valores ``Py_DTSF_SIGN``, "
222+ "``Py_DTSF_ADD_DOT_0`` ou ``Py_DTSF_ALT``, alternados por operador lógico OU:"
169223
170224#: ../../c-api/conversion.rst:101
171225msgid ""
172226"``Py_DTSF_SIGN`` means to always precede the returned string with a sign "
173227"character, even if *val* is non-negative."
174228msgstr ""
229+ "``Py_DTSF_SIGN`` significa sempre preceder a string retornada com um "
230+ "caractere de sinal, mesmo se *val* não for negativo."
175231
176232#: ../../c-api/conversion.rst:104
177233msgid ""
178234"``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look "
179235"like an integer."
180236msgstr ""
237+ "``Py_DTSF_ADD_DOT_0`` significa garantir que a string retornada não se "
238+ "pareça com um inteiro."
181239
182240#: ../../c-api/conversion.rst:107
183241msgid ""
184242"``Py_DTSF_ALT`` means to apply \" alternate\" formatting rules. See the "
185243"documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for details."
186244msgstr ""
245+ "``Py_DTSF_ALT`` significa aplicar regras de formatação \" alternativas\" . "
246+ "Veja a documentação para o especificador ``'#'`` de :c:func:`PyOS_snprintf` "
247+ "para detalhes."
187248
188249#: ../../c-api/conversion.rst:111
189250msgid ""
@@ -192,22 +253,34 @@ msgid ""
192253"that *val* is a finite number, an infinite number, or not a number, "
193254"respectively."
194255msgstr ""
256+ "Se *type* não for ``NULL``, então o valor para o qual ele aponta será "
257+ "definido como um dos ``Py_DTST_FINITE``, ``Py_DTST_INFINITE`` ou "
258+ "``Py_DTST_NAN``, significando que *val* é um número finito, um número "
259+ "infinito ou não um número, respectivamente."
195260
196261#: ../../c-api/conversion.rst:115
197262msgid ""
198263"The return value is a pointer to *buffer* with the converted string or "
199264"``NULL`` if the conversion failed. The caller is responsible for freeing the "
200265"returned string by calling :c:func:`PyMem_Free`."
201266msgstr ""
267+ "O valor de retorno é um ponteiro para *buffer* com a string convertida ou "
268+ "``NULL`` se a conversão falhou. O chamador é responsável por liberar a "
269+ "string retornada chamando :c:func:`PyMem_Free`."
202270
203271#: ../../c-api/conversion.rst:124
204272msgid ""
205273"Case insensitive comparison of strings. The function works almost "
206274"identically to :c:func:`strcmp` except that it ignores the case."
207275msgstr ""
276+ "Comparação de strings sem diferença entre maiúsculas e minúsculas. A função "
277+ "funciona quase de forma idêntica a :c:func:`strcmp` exceto que ignora o caso."
208278
209279#: ../../c-api/conversion.rst:130
210280msgid ""
211281"Case insensitive comparison of strings. The function works almost "
212282"identically to :c:func:`strncmp` except that it ignores the case."
213283msgstr ""
284+ "Comparação de strings sem diferença entre maiúsculas e minúsculas. A função "
285+ "funciona quase de forma idêntica a :c:func:`strncmp` exceto que ignora o "
286+ "caso."
0 commit comments