Skip to content

Commit e177c4d

Browse files
pomerge from 3.9 branch into 3.7
1 parent 75732b0 commit e177c4d

File tree

10 files changed

+372
-22
lines changed

10 files changed

+372
-22
lines changed

c-api/contextvars.po

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,31 @@ msgid ""
3333
"**changed** to use :c:type:`PyObject` pointers instead of :c:type:"
3434
"`PyContext`, :c:type:`PyContextVar`, and :c:type:`PyContextToken`, e.g.::"
3535
msgstr ""
36+
"No Python 3.7.1, as assinaturas de todas as APIs C de variáveis de contexto "
37+
"foram **alteradas** para usar ponteiros :c:type:`PyObject` em vez de :c:type:"
38+
"`PyContext`, :c:type:`PyContextVar` e :c:type:`PyContextToken`. Por exemplo::"
3639

3740
#: ../../c-api/contextvars.rst:24
3841
msgid "See :issue:`34762` for more details."
39-
msgstr ""
42+
msgstr "Veja :issue:`34762` para mais detalhes."
4043

4144
#: ../../c-api/contextvars.rst:29
4245
msgid ""
4346
"This section details the public C API for the :mod:`contextvars` module."
44-
msgstr ""
47+
msgstr "Esta seção detalha a API C pública para o módulo :mod:`contextvars`."
4548

4649
#: ../../c-api/contextvars.rst:33
4750
msgid ""
4851
"The C structure used to represent a :class:`contextvars.Context` object."
4952
msgstr ""
53+
"A estrutura C usada para representar um objeto :class:`contextvars.Context`."
5054

5155
#: ../../c-api/contextvars.rst:38
5256
msgid ""
5357
"The C structure used to represent a :class:`contextvars.ContextVar` object."
5458
msgstr ""
59+
"A estrutura C usada para representar um objeto :class:`contextvars."
60+
"ContextVar`."
5561

5662
#: ../../c-api/contextvars.rst:43
5763
msgid "The C structure used to represent a :class:`contextvars.Token` object."
@@ -60,15 +66,16 @@ msgstr ""
6066

6167
#: ../../c-api/contextvars.rst:47
6268
msgid "The type object representing the *context* type."
63-
msgstr ""
69+
msgstr "O objeto de tipo que representa o tipo de *contexto*."
6470

6571
#: ../../c-api/contextvars.rst:51
6672
msgid "The type object representing the *context variable* type."
67-
msgstr ""
73+
msgstr "O objeto de tipo que representa o tipo de *variável de contexto*."
6874

6975
#: ../../c-api/contextvars.rst:55
7076
msgid "The type object representing the *context variable token* type."
7177
msgstr ""
78+
"O objeto de tipo que representa o tipo de *token de variável de contexto*."
7279

7380
#: ../../c-api/contextvars.rst:58
7481
msgid "Type-check macros:"
@@ -79,22 +86,28 @@ msgid ""
7986
"Return true if *o* is of type :c:data:`PyContext_Type`. *o* must not be "
8087
"``NULL``. This function always succeeds."
8188
msgstr ""
89+
"Retorna verdadeiro se *o* for do tipo :c:data:`PyContext_Type`. *o* não deve "
90+
"ser ``NULL``. Esta função sempre tem sucesso."
8291

8392
#: ../../c-api/contextvars.rst:67
8493
msgid ""
8594
"Return true if *o* is of type :c:data:`PyContextVar_Type`. *o* must not be "
8695
"``NULL``. This function always succeeds."
8796
msgstr ""
97+
"Retorna verdadeiro se *o* for do tipo :c:data:`PyContextVar_Type`. *o* não "
98+
"deve ser ``NULL``. Esta função sempre tem sucesso."
8899

89100
#: ../../c-api/contextvars.rst:72
90101
msgid ""
91102
"Return true if *o* is of type :c:data:`PyContextToken_Type`. *o* must not be "
92103
"``NULL``. This function always succeeds."
93104
msgstr ""
105+
"Retorna verdadeiro se *o* for do tipo :c:data:`PyContextToken_Type`. *o* não "
106+
"deve ser ``NULL``. Esta função sempre tem sucesso."
94107

95108
#: ../../c-api/contextvars.rst:76
96109
msgid "Context object management functions:"
97-
msgstr ""
110+
msgstr "Funções de gerenciamento de objetos de contexto:"
98111

99112
#: ../../c-api/contextvars.rst:80
100113
msgid ""
@@ -124,13 +137,18 @@ msgid ""
124137
"Set *ctx* as the current context for the current thread. Returns ``0`` on "
125138
"success, and ``-1`` on error."
126139
msgstr ""
140+
"Defina *ctx* como o contexto atual para o thread atual. Retorna ``0`` em "
141+
"caso de sucesso e ``-1`` em caso de erro."
127142

128143
#: ../../c-api/contextvars.rst:100
129144
msgid ""
130145
"Deactivate the *ctx* context and restore the previous context as the current "
131146
"context for the current thread. Returns ``0`` on success, and ``-1`` on "
132147
"error."
133148
msgstr ""
149+
"Desativa o contexto *ctx* e restaura o contexto anterior como o contexto "
150+
"atual para a thread atual. Retorna ``0`` em caso de sucesso e ``-1`` em caso "
151+
"de erro."
134152

135153
#: ../../c-api/contextvars.rst:106
136154
msgid ""
@@ -140,7 +158,7 @@ msgstr ""
140158

141159
#: ../../c-api/contextvars.rst:110
142160
msgid "Context variable functions:"
143-
msgstr ""
161+
msgstr "Funções de variável de contexto:"
144162

145163
#: ../../c-api/contextvars.rst:114
146164
msgid ""
@@ -149,27 +167,36 @@ msgid ""
149167
"specify the default value for the context variable. If an error has "
150168
"occurred, this function returns ``NULL``."
151169
msgstr ""
170+
"Cria um novo objeto ``ContextVar``. O parâmetro *name* é usado para fins de "
171+
"introspecção e depuração. O parâmetro *def* pode opcionalmente especificar o "
172+
"valor padrão para a variável de contexto. Se ocorrer um erro, esta função "
173+
"retorna ``NULL``."
152174

153175
#: ../../c-api/contextvars.rst:121
154176
msgid ""
155177
"Get the value of a context variable. Returns ``-1`` if an error has "
156178
"occurred during lookup, and ``0`` if no error occurred, whether or not a "
157179
"value was found."
158180
msgstr ""
181+
"Obtém o valor de uma variável de contexto. Retorna ``-1`` se um erro ocorreu "
182+
"durante a pesquisa, e ``0`` se nenhum erro ocorreu, se um valor foi "
183+
"encontrado ou não."
159184

160185
#: ../../c-api/contextvars.rst:125
161186
msgid ""
162187
"If the context variable was found, *value* will be a pointer to it. If the "
163188
"context variable was *not* found, *value* will point to:"
164189
msgstr ""
190+
"Se a variável de contexto foi encontrada, *value* será um ponteiro para ela. "
191+
"Se a variável de contexto *não* foi encontrada, *value* apontará para:"
165192

166193
#: ../../c-api/contextvars.rst:128
167194
msgid "*default_value*, if not ``NULL``;"
168-
msgstr ""
195+
msgstr "*default_value*, se não for ``NULL``;"
169196

170197
#: ../../c-api/contextvars.rst:129
171198
msgid "the default value of *var*, if not ``NULL``;"
172-
msgstr ""
199+
msgstr "o valor padrão de *var*, se não for ``NULL``;"
173200

174201
#: ../../c-api/contextvars.rst:130
175202
msgid "``NULL``"
@@ -178,16 +205,22 @@ msgstr "``NULL``"
178205
#: ../../c-api/contextvars.rst:132
179206
msgid "If the value was found, the function will create a new reference to it."
180207
msgstr ""
208+
"Se o valor for encontrado, a função criará uma nova referência para ele."
181209

182210
#: ../../c-api/contextvars.rst:136
183211
msgid ""
184212
"Set the value of *var* to *value* in the current context. Returns a pointer "
185213
"to a :c:type:`PyObject` object, or ``NULL`` if an error has occurred."
186214
msgstr ""
215+
"Define o valor de *var* como *value* no contexto atual. Retorna um ponteiro "
216+
"para um objeto :c:type:`PyObject`, ou ``NULL`` se um erro ocorreu."
187217

188218
#: ../../c-api/contextvars.rst:142
189219
msgid ""
190220
"Reset the state of the *var* context variable to that it was in before :c:"
191221
"func:`PyContextVar_Set` that returned the *token* was called. This function "
192222
"returns ``0`` on success and ``-1`` on error."
193223
msgstr ""
224+
"Redefine o estado da variável de contexto *var* para o estado que anterior "
225+
"a :c:func:`PyContextVar_Set` que retornou o *token* foi chamado. Esta função "
226+
"retorna ``0`` em caso de sucesso e ``-1`` em caso de erro."

c-api/conversion.po

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ msgid ""
5858
"is to guarantee consistent behavior in corner cases, which the Standard C "
5959
"functions do not."
6060
msgstr ""
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
6367
msgid ""
@@ -66,45 +70,65 @@ msgid ""
6670
"into str. Both functions require that ``str != NULL``, ``size > 0`` and "
6771
"``format != NULL``."
6872
msgstr ""
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
7179
msgid ""
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`."
7583
msgstr ""
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
7889
msgid ""
7990
"The return value (*rv*) for these functions should be interpreted as follows:"
8091
msgstr ""
92+
"O valor de retorno (*rv*) para essas funções deve ser interpretado da "
93+
"seguinte forma:"
8194

8295
#: ../../c-api/conversion.rst:39
8396
msgid ""
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*])."
87100
msgstr ""
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
90106
msgid ""
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."
94110
msgstr ""
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
97116
msgid ""
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."
101120
msgstr ""
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
104126
msgid ""
105127
"The following functions provide locale-independent string to number "
106128
"conversions."
107129
msgstr ""
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
110134
msgid ""
@@ -114,13 +138,21 @@ msgid ""
114138
"have leading or trailing whitespace. The conversion is independent of the "
115139
"current locale."
116140
msgstr ""
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
119148
msgid ""
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."
123152
msgstr ""
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
126158
msgid ""
@@ -130,6 +162,11 @@ msgid ""
130162
"number, set ``*endptr`` to point to the beginning of the string, raise "
131163
"ValueError, and return ``-1.0``."
132164
msgstr ""
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
135172
msgid ""
@@ -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."
143180
msgstr ""
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
146190
msgid ""
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``."
149193
msgstr ""
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
152198
msgid ""
153199
"Convert a :c:type:`double` *val* to a string using supplied *format_code*, "
154200
"*precision*, and *flags*."
155201
msgstr ""
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
158206
msgid ""
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."
162210
msgstr ""
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
165217
msgid ""
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:"
168220
msgstr ""
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
171225
msgid ""
172226
"``Py_DTSF_SIGN`` means to always precede the returned string with a sign "
173227
"character, even if *val* is non-negative."
174228
msgstr ""
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
177233
msgid ""
178234
"``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look "
179235
"like an integer."
180236
msgstr ""
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
183241
msgid ""
184242
"``Py_DTSF_ALT`` means to apply \"alternate\" formatting rules. See the "
185243
"documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for details."
186244
msgstr ""
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
189250
msgid ""
@@ -192,22 +253,34 @@ msgid ""
192253
"that *val* is a finite number, an infinite number, or not a number, "
193254
"respectively."
194255
msgstr ""
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
197262
msgid ""
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`."
201266
msgstr ""
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
204272
msgid ""
205273
"Case insensitive comparison of strings. The function works almost "
206274
"identically to :c:func:`strcmp` except that it ignores the case."
207275
msgstr ""
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
210280
msgid ""
211281
"Case insensitive comparison of strings. The function works almost "
212282
"identically to :c:func:`strncmp` except that it ignores the case."
213283
msgstr ""
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

Comments
 (0)