@@ -11,7 +11,7 @@ msgid ""
11
11
msgstr ""
12
12
"Project-Id-Version : Python 3.14\n "
13
13
"Report-Msgid-Bugs-To : \n "
14
- "POT-Creation-Date : 2025-05-09 14:19 +0000\n "
14
+ "POT-Creation-Date : 2025-07-31 14:20 +0000\n "
15
15
"PO-Revision-Date : 2025-07-18 18:48+0000\n "
16
16
"Last-Translator : Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n "
17
17
"Language-Team : Portuguese (Brazil) (https://app.transifex.com/python-doc/ "
@@ -62,10 +62,20 @@ msgstr ""
62
62
"`~object.__lt__` e retornarão um ponto de inserção entre valores em um vetor."
63
63
64
64
#: ../../library/bisect.rst:29
65
+ msgid ""
66
+ "The functions in this module are not thread-safe. If multiple threads "
67
+ "concurrently use :mod:`bisect` functions on the same sequence, this may "
68
+ "result in undefined behaviour. Likewise, if the provided sequence is mutated "
69
+ "by a different thread while a :mod:`bisect` function is operating on it, the "
70
+ "result is undefined. For example, using :py:func:`~bisect.insort_left` on "
71
+ "the same list from multiple threads may result in the list becoming unsorted."
72
+ msgstr ""
73
+
74
+ #: ../../library/bisect.rst:39
65
75
msgid "The following functions are provided:"
66
76
msgstr "As seguintes funções são fornecidas:"
67
77
68
- #: ../../library/bisect.rst:34
78
+ #: ../../library/bisect.rst:44
69
79
msgid ""
70
80
"Locate the insertion point for *x* in *a* to maintain sorted order. The "
71
81
"parameters *lo* and *hi* may be used to specify a subset of the list which "
@@ -82,7 +92,7 @@ msgstr ""
82
92
"para uso como o primeiro parâmetro para ``list.insert()`` supondo que *a* já "
83
93
"esteja ordenado."
84
94
85
- #: ../../library/bisect.rst:41
95
+ #: ../../library/bisect.rst:51
86
96
msgid ""
87
97
"The returned insertion point *ip* partitions the array *a* into two slices "
88
98
"such that ``all(elem < x for elem in a[lo : ip])`` is true for the left "
@@ -94,7 +104,7 @@ msgstr ""
94
104
"fatia esquerda e ``all(elem >= x for elem in a[ip : hi])`` é verdadeiro para "
95
105
"a fatia certa."
96
106
97
- #: ../../library/bisect.rst:46
107
+ #: ../../library/bisect.rst:56
98
108
msgid ""
99
109
"*key* specifies a :term:`key function` of one argument that is used to "
100
110
"extract a comparison key from each element in the array. To support "
@@ -105,20 +115,20 @@ msgstr ""
105
115
"suporte à pesquisa de registros complexos, a função chave não é aplicada ao "
106
116
"valor *x*."
107
117
108
- #: ../../library/bisect.rst:50
118
+ #: ../../library/bisect.rst:60
109
119
msgid ""
110
120
"If *key* is ``None``, the elements are compared directly and no key function "
111
121
"is called."
112
122
msgstr ""
113
123
"Se *key* for ``None``, os elementos serão comparados diretamente e nenhuma "
114
124
"função chave será chamada."
115
125
116
- #: ../../library/bisect.rst:53 ../../library/bisect.rst:67
117
- #: ../../library/bisect.rst:85 ../../library/bisect.rst:105
126
+ #: ../../library/bisect.rst:63 ../../library/bisect.rst:77
127
+ #: ../../library/bisect.rst:95 ../../library/bisect.rst:115
118
128
msgid "Added the *key* parameter."
119
129
msgstr "Adicionado o parâmetro *key*."
120
130
121
- #: ../../library/bisect.rst:60
131
+ #: ../../library/bisect.rst:70
122
132
msgid ""
123
133
"Similar to :py:func:`~bisect.bisect_left`, but returns an insertion point "
124
134
"which comes after (to the right of) any existing entries of *x* in *a*."
@@ -127,7 +137,7 @@ msgstr ""
127
137
"inserção que vem depois (à direita de) qualquer entrada existente de *x* em "
128
138
"*a*."
129
139
130
- #: ../../library/bisect.rst:63
140
+ #: ../../library/bisect.rst:73
131
141
msgid ""
132
142
"The returned insertion point *ip* partitions the array *a* into two slices "
133
143
"such that ``all(elem <= x for elem in a[lo : ip])`` is true for the left "
@@ -139,11 +149,11 @@ msgstr ""
139
149
"fatia esquerda e ``all(elem > x for elem in a[ip : hi])`` é verdadeiro para "
140
150
"a fatia certa."
141
151
142
- #: ../../library/bisect.rst:73
152
+ #: ../../library/bisect.rst:83
143
153
msgid "Insert *x* in *a* in sorted order."
144
154
msgstr "Insere *x* em *a* na ordem de classificação."
145
155
146
- #: ../../library/bisect.rst:75
156
+ #: ../../library/bisect.rst:85
147
157
msgid ""
148
158
"This function first runs :py:func:`~bisect.bisect_left` to locate an "
149
159
"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert "
@@ -154,7 +164,7 @@ msgstr ""
154
164
"*a* para inserir *x* na posição apropriada para manter a ordem de "
155
165
"classificação."
156
166
157
- #: ../../library/bisect.rst:79 ../../library/bisect.rst:99
167
+ #: ../../library/bisect.rst:89 ../../library/bisect.rst:109
158
168
msgid ""
159
169
"To support inserting records in a table, the *key* function (if any) is "
160
170
"applied to *x* for the search step but not for the insertion step."
@@ -163,23 +173,23 @@ msgstr ""
163
173
"(se houver) é aplicada a *x* para a etapa de pesquisa, mas não para a etapa "
164
174
"de inserção."
165
175
166
- #: ../../library/bisect.rst:82 ../../library/bisect.rst:102
176
+ #: ../../library/bisect.rst:92 ../../library/bisect.rst:112
167
177
msgid ""
168
178
"Keep in mind that the *O*\\ (log *n*) search is dominated by the slow *O*\\ "
169
179
"(*n*) insertion step."
170
180
msgstr ""
171
181
"Tenha em mente que a busca *O*\\ (log *n*) é dominada pelo etapa de inserção "
172
182
"lenta O(n)."
173
183
174
- #: ../../library/bisect.rst:92
184
+ #: ../../library/bisect.rst:102
175
185
msgid ""
176
186
"Similar to :py:func:`~bisect.insort_left`, but inserting *x* in *a* after "
177
187
"any existing entries of *x*."
178
188
msgstr ""
179
189
"Semelhante a :py:func:`~bisect.insort_left`, mas inserindo *x* em *a* após "
180
190
"qualquer entrada existente de *x*."
181
191
182
- #: ../../library/bisect.rst:95
192
+ #: ../../library/bisect.rst:105
183
193
msgid ""
184
194
"This function first runs :py:func:`~bisect.bisect_right` to locate an "
185
195
"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert "
@@ -190,35 +200,35 @@ msgstr ""
190
200
"*a* para inserir *x* na posição apropriada para manter a ordem de "
191
201
"classificação."
192
202
193
- #: ../../library/bisect.rst:110
203
+ #: ../../library/bisect.rst:120
194
204
msgid "Performance Notes"
195
205
msgstr "Observações sobre desempenho"
196
206
197
- #: ../../library/bisect.rst:112
207
+ #: ../../library/bisect.rst:122
198
208
msgid ""
199
209
"When writing time sensitive code using *bisect()* and *insort()*, keep these "
200
210
"thoughts in mind:"
201
211
msgstr ""
202
212
"Ao escrever um código sensível ao tempo usando *bisect()* e *insort()*, "
203
213
"lembre-se do seguinte:"
204
214
205
- #: ../../library/bisect.rst:115
215
+ #: ../../library/bisect.rst:125
206
216
msgid ""
207
217
"Bisection is effective for searching ranges of values. For locating specific "
208
218
"values, dictionaries are more performant."
209
219
msgstr ""
210
220
"A bisseção é eficaz para pesquisar intervalos de valores. Para localizar "
211
221
"valores específicos, os dicionários são mais eficientes."
212
222
213
- #: ../../library/bisect.rst:118
223
+ #: ../../library/bisect.rst:128
214
224
msgid ""
215
225
"The *insort()* functions are *O*\\ (*n*) because the logarithmic search step "
216
226
"is dominated by the linear time insertion step."
217
227
msgstr ""
218
228
"As funções *insort()* são *O*\\ (*n*) porque a etapa de busca logarítmica é "
219
229
"dominada pela etapa de inserção de tempo linear."
220
230
221
- #: ../../library/bisect.rst:121
231
+ #: ../../library/bisect.rst:131
222
232
msgid ""
223
233
"The search functions are stateless and discard key function results after "
224
234
"they are used. Consequently, if the search functions are used in a loop, "
@@ -237,7 +247,7 @@ msgstr ""
237
247
"localizar o ponto de inserção (conforme mostrado na seção de exemplos "
238
248
"abaixo)."
239
249
240
- #: ../../library/bisect.rst:131
250
+ #: ../../library/bisect.rst:141
241
251
msgid ""
242
252
"`Sorted Collections <https://grantjenks.com/docs/sortedcollections/>`_ is a "
243
253
"high performance module that uses *bisect* to managed sorted collections of "
@@ -247,7 +257,7 @@ msgstr ""
247
257
"módulo de alto desempenho que usa bisseção para gerenciar coleções de dados "
248
258
"classificadas."
249
259
250
- #: ../../library/bisect.rst:135
260
+ #: ../../library/bisect.rst:145
251
261
msgid ""
252
262
"The `SortedCollection recipe <https://code.activestate.com/recipes/577197-"
253
263
"sortedcollection/>`_ uses bisect to build a full-featured collection class "
@@ -261,11 +271,11 @@ msgstr ""
261
271
"chaves são pré-calculadas para economizar em chamadas desnecessárias para a "
262
272
"função chave durante as buscas."
263
273
264
- #: ../../library/bisect.rst:143
274
+ #: ../../library/bisect.rst:153
265
275
msgid "Searching Sorted Lists"
266
276
msgstr "Buscando em listas ordenadas"
267
277
268
- #: ../../library/bisect.rst:145
278
+ #: ../../library/bisect.rst:155
269
279
msgid ""
270
280
"The above `bisect functions`_ are useful for finding insertion points but "
271
281
"can be tricky or awkward to use for common searching tasks. The following "
@@ -277,7 +287,7 @@ msgstr ""
277
287
"As cinco funções a seguir mostram como transformá-las nas buscas padrão para "
278
288
"listas ordenadas::"
279
289
280
- #: ../../library/bisect.rst:150
290
+ #: ../../library/bisect.rst:160
281
291
msgid ""
282
292
"def index(a, x):\n"
283
293
" 'Locate the leftmost value exactly equal to x'\n"
@@ -349,11 +359,11 @@ msgstr ""
349
359
" return a[i]\n"
350
360
" raise ValueError"
351
361
352
- #: ../../library/bisect.rst:187
362
+ #: ../../library/bisect.rst:197
353
363
msgid "Examples"
354
364
msgstr "Exemplos"
355
365
356
- #: ../../library/bisect.rst:191
366
+ #: ../../library/bisect.rst:201
357
367
msgid ""
358
368
"The :py:func:`~bisect.bisect` function can be useful for numeric table "
359
369
"lookups. This example uses :py:func:`~bisect.bisect` to look up a letter "
@@ -366,7 +376,7 @@ msgstr ""
366
376
"pontos de interrupção numéricos ordenados: 90 e acima é um \" A\" , 80 a 89 é "
367
377
"um \" B\" e por aí vai::"
368
378
369
- #: ../../library/bisect.rst:196
379
+ #: ../../library/bisect.rst:206
370
380
msgid ""
371
381
">>> def grade(score, breakpoints=[60, 70, 80, 90], grades='FDCBA'):\n"
372
382
"... i = bisect(breakpoints, score)\n"
@@ -382,7 +392,7 @@ msgstr ""
382
392
">>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]\n"
383
393
"['F', 'A', 'C', 'C', 'B', 'A', 'A']"
384
394
385
- #: ../../library/bisect.rst:203
395
+ #: ../../library/bisect.rst:213
386
396
msgid ""
387
397
"The :py:func:`~bisect.bisect` and :py:func:`~bisect.insort` functions also "
388
398
"work with lists of tuples. The *key* argument can serve to extract the "
@@ -392,7 +402,7 @@ msgstr ""
392
402
"funcionam com listas de tuplas. O argumento *key* pode servir para extrair o "
393
403
"campo usado para ordenar registros em uma tabela::"
394
404
395
- #: ../../library/bisect.rst:207
405
+ #: ../../library/bisect.rst:217
396
406
msgid ""
397
407
">>> from collections import namedtuple\n"
398
408
">>> from operator import attrgetter\n"
@@ -454,7 +464,7 @@ msgstr ""
454
464
" Movie(name='Aliens', released=1986, director='Cameron'),\n"
455
465
" Movie(name='Titanic', released=1997, director='Cameron')]"
456
466
457
- #: ../../library/bisect.rst:237
467
+ #: ../../library/bisect.rst:247
458
468
msgid ""
459
469
"If the key function is expensive, it is possible to avoid repeated function "
460
470
"calls by searching a list of precomputed keys to find the index of a record::"
@@ -463,7 +473,7 @@ msgstr ""
463
473
"repetidas buscando uma lista de chaves pré-calculadas para encontrar o "
464
474
"índice de um registro::"
465
475
466
- #: ../../library/bisect.rst:240
476
+ #: ../../library/bisect.rst:250
467
477
msgid ""
468
478
">>> data = [('red', 5), ('blue', 1), ('yellow', 8), ('black', 0)]\n"
469
479
">>> data.sort(key=lambda r: r[1]) # Or use operator.itemgetter(1).\n"
0 commit comments