@@ -125,6 +125,10 @@ msgid ""
125
125
"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert "
126
126
"*x* at the appropriate position to maintain sort order."
127
127
msgstr ""
128
+ "Esta função primeiro executa :py:func:`~bisect.bisect_left` para localizar "
129
+ "um ponto de inserção. Em seguida, ele executa o método :meth:`!insert` em "
130
+ "*a* para inserir *x* na posição apropriada para manter a ordem de "
131
+ "classificação."
128
132
129
133
#: ../../library/bisect.rst:79 ../../library/bisect.rst:99
130
134
msgid ""
@@ -140,6 +144,8 @@ msgid ""
140
144
"Keep in mind that the *O*\\ (log *n*) search is dominated by the slow *O*\\ "
141
145
"(*n*) insertion step."
142
146
msgstr ""
147
+ "Tenha em mente que a busca *O*\\ (log *n*) é dominada pelo etapa de inserção "
148
+ "lenta O(n)."
143
149
144
150
#: ../../library/bisect.rst:92
145
151
msgid ""
@@ -155,6 +161,10 @@ msgid ""
155
161
"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert "
156
162
"*x* at the appropriate position to maintain sort order."
157
163
msgstr ""
164
+ "Esta função primeiro executa :py:func:`~bisect.bisect_right` para localizar "
165
+ "um ponto de inserção. Em seguida, ele executa o método :meth:`!insert` em "
166
+ "*a* para inserir *x* na posição apropriada para manter a ordem de "
167
+ "classificação."
158
168
159
169
#: ../../library/bisect.rst:110
160
170
msgid "Performance Notes"
@@ -181,6 +191,8 @@ msgid ""
181
191
"The *insort()* functions are *O*\\ (*n*) because the logarithmic search step "
182
192
"is dominated by the linear time insertion step."
183
193
msgstr ""
194
+ "As funções *insort()* são *O*\\ (*n*) porque a etapa de busca logarítmica é "
195
+ "dominada pela etapa de inserção de tempo linear."
184
196
185
197
#: ../../library/bisect.rst:121
186
198
msgid ""
@@ -192,13 +204,24 @@ msgid ""
192
204
"searching an array of precomputed keys to locate the insertion point (as "
193
205
"shown in the examples section below)."
194
206
msgstr ""
207
+ "As funções de busca são stateless e descartam os resultados da função chave "
208
+ "depois que são usadas. Consequentemente, se as funções de busca forem usadas "
209
+ "em um laço, a função chave pode ser chamada repetidamente nos mesmos "
210
+ "elementos do vetor. Se a função chave não for rápida, considere envolvê-la "
211
+ "com :py:func:`functools.cache` para evitar cálculos duplicados. Como "
212
+ "alternativa, considere pesquisar um array de chaves pré-calculadas para "
213
+ "localizar o ponto de inserção (conforme mostrado na seção de exemplos "
214
+ "abaixo)."
195
215
196
216
#: ../../library/bisect.rst:131
197
217
msgid ""
198
218
"`Sorted Collections <https://grantjenks.com/docs/sortedcollections/>`_ is a "
199
219
"high performance module that uses *bisect* to managed sorted collections of "
200
220
"data."
201
221
msgstr ""
222
+ "`Sorted Collections <https://grantjenks.com/docs/sortedcollections/>`_ é um "
223
+ "módulo de alto desempenho que usa *bisect* para gerenciar coleções de dados "
224
+ "classificadas."
202
225
203
226
#: ../../library/bisect.rst:135
204
227
msgid ""
@@ -208,10 +231,15 @@ msgid ""
208
231
"keys are precomputed to save unnecessary calls to the key function during "
209
232
"searches."
210
233
msgstr ""
234
+ "A `receita de SortedCollection <https://code.activestate.com/recipes/577197-"
235
+ "sortedcollection/>`_ usa bisect para construir uma classe de coleção "
236
+ "completa com métodos de pesquisa diretos e suporte para uma função chave. As "
237
+ "chaves são pré-calculadas para economizar em chamadas desnecessárias para a "
238
+ "função chave durante as pesquisas."
211
239
212
240
#: ../../library/bisect.rst:143
213
241
msgid "Searching Sorted Lists"
214
- msgstr "Pesquisando em listas ordenadas"
242
+ msgstr "Buscando em listas ordenadas"
215
243
216
244
#: ../../library/bisect.rst:145
217
245
msgid ""
@@ -220,6 +248,10 @@ msgid ""
220
248
"five functions show how to transform them into the standard lookups for "
221
249
"sorted lists::"
222
250
msgstr ""
251
+ "As `funções bisect`_ acima são úteis para encontrar pontos de inserção, mas "
252
+ "podem ser complicadas ou difíceis de usar para tarefas comuns de busca. As "
253
+ "cinco funções a seguir mostram como transformá-las nas buscas padrão para "
254
+ "listas ordenadas::"
223
255
224
256
#: ../../library/bisect.rst:187
225
257
msgid "Examples"
@@ -232,16 +264,27 @@ msgid ""
232
264
"grade for an exam score (say) based on a set of ordered numeric breakpoints: "
233
265
"90 and up is an 'A', 80 to 89 is a 'B', and so on::"
234
266
msgstr ""
267
+ "A função :py:func:`~bisect.bisect` pode ser útil para pesquisas em tabelas "
268
+ "numéricas. Este exemplo usa :py:func:`~bisect.bisect` para pesquisar uma "
269
+ "nota em letra para uma pontuação de exame (digamos) com base em um conjunto "
270
+ "de pontos de interrupção numéricos ordenados: 90 e acima é um \" A\" , 80 a 89 "
271
+ "é um \" B\" e por aí vai::"
235
272
236
273
#: ../../library/bisect.rst:203
237
274
msgid ""
238
275
"The :py:func:`~bisect.bisect` and :py:func:`~bisect.insort` functions also "
239
276
"work with lists of tuples. The *key* argument can serve to extract the "
240
277
"field used for ordering records in a table::"
241
278
msgstr ""
279
+ "As funções :py:func:`~bisect.bisect` e :py:func:`~bisect.insort` também "
280
+ "funcionam com listas de tuplas. O argumento *key* pode servir para extrair o "
281
+ "campo usado para ordenar registros em uma tabela::"
242
282
243
283
#: ../../library/bisect.rst:237
244
284
msgid ""
245
285
"If the key function is expensive, it is possible to avoid repeated function "
246
286
"calls by searching a list of precomputed keys to find the index of a record::"
247
287
msgstr ""
288
+ "Se a função chave for custosa, é possível evitar chamadas de função "
289
+ "repetidas pesquisando uma lista de chaves pré-calculadas para encontrar o "
290
+ "índice de um registro::"
0 commit comments