-
-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathcollections.po
More file actions
1652 lines (1454 loc) · 85.5 KB
/
collections.po
File metadata and controls
1652 lines (1454 loc) · 85.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2023, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Marco Rougeth <marco@rougeth.com>, 2019
# Welington Carlos <wcarlos3@gmail.com>, 2019
# Claudio Rogerio Carvalho Filho <excriptbrasil@gmail.com>, 2019
# Alexandre B A Villares, 2021
# i17obot <i17obot@rougeth.com>, 2021
# Vitor Buxbaum Orlandi, 2021
# João Porfirio, 2022
# Jader Oliveira, 2022
# Rafael Fontenelle <rffontenelle@gmail.com>, 2024
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.7\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-23 16:56+0000\n"
"PO-Revision-Date: 2019-09-01 03:13+0000\n"
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2024\n"
"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/"
"teams/5390/pt_BR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pt_BR\n"
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % "
"1000000 == 0 ? 1 : 2;\n"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:2
msgid ":mod:`collections` --- Container datatypes"
msgstr "Tipos de dados do contêiner "
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:10
msgid "**Source code:** :source:`Lib/collections/__init__.py`"
msgstr "**Source code:** :source:`Lib/collections/__init__.py`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:20
msgid ""
"This module implements specialized container datatypes providing "
"alternatives to Python's general purpose built-in containers, :class:"
"`dict`, :class:`list`, :class:`set`, and :class:`tuple`."
msgstr ""
"Este módulo implementa tipos de dados de contêiner especializados que "
"fornecem alternativas aos contêineres integrados de uso geral do Python, :"
"class:`dict`, :class:`list`, :class:`set`, and :class:`tuple`."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:25
msgid ":func:`namedtuple`"
msgstr ":func:`namedtuple`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:25
msgid "factory function for creating tuple subclasses with named fields"
msgstr "Função de fábrica para criar subclasses de tuplas com campos nomeados"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:26
msgid ":class:`deque`"
msgstr ":class:`deque`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:26
msgid "list-like container with fast appends and pops on either end"
msgstr "Contêiner semelhante a list com rápido appends e pops em qualquer fim"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:27
msgid ":class:`ChainMap`"
msgstr ":class:`ChainMap`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:27
msgid "dict-like class for creating a single view of multiple mappings"
msgstr ""
"Classe semelhante ao dict(dicionário) para criar uma visão única de vários "
"mapeamentos"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:28
msgid ":class:`Counter`"
msgstr ":class:`Counter`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:28
msgid "dict subclass for counting hashable objects"
msgstr "Subclasse de Dict para contar objetos hashable"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:29
msgid ":class:`OrderedDict`"
msgstr ":class:`OrderedDict`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:29
msgid "dict subclass that remembers the order entries were added"
msgstr "Subclasse de Dict que lembra a ordem que as entradas foram adicionadas"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:30
msgid ":class:`defaultdict`"
msgstr ":class:`defaultdict`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:30
msgid "dict subclass that calls a factory function to supply missing values"
msgstr ""
"Subclasse de Dict que chama uma função de fábrica (factory function) para "
"fornecer valores em faltam"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:31
msgid ":class:`UserDict`"
msgstr ":class:`UserDict`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:31
msgid "wrapper around dictionary objects for easier dict subclassing"
msgstr ""
"Envoltório em torno de objetos de dictionary para uma subclasse de dict mais "
"fácil"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:32
msgid ":class:`UserList`"
msgstr ":class:`UserList`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:32
msgid "wrapper around list objects for easier list subclassing"
msgstr ""
"Invólucro em torno de objetos de list para uma subclasse de list mais fácil"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:33
msgid ":class:`UserString`"
msgstr ":class:`UserString`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:33
msgid "wrapper around string objects for easier string subclassing"
msgstr "Invólucro em torno de objetos strings para uma subclasse mais fácil"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:41
msgid ""
"Moved :ref:`collections-abstract-base-classes` to the :mod:`collections.abc` "
"module. For backwards compatibility, they continue to be visible in this "
"module through Python 3.8."
msgstr ""
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:43
msgid ":class:`ChainMap` objects"
msgstr ":class:`ChainMap` objects"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:47
msgid ""
"A :class:`ChainMap` class is provided for quickly linking a number of "
"mappings so they can be treated as a single unit. It is often much faster "
"than creating a new dictionary and running multiple :meth:`~dict.update` "
"calls."
msgstr ""
"Uma classe :class:`ChainMap` é fornecido para ligar rapidamente uma série de "
"mapeamentos para que eles possam ser tratados como uma única unidade. Muitas "
"vezes é muito mais rápido do que criar um novo dicionário e executar "
"múltiplas chamadas :meth:`~dict.update` "
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:51
msgid ""
"The class can be used to simulate nested scopes and is useful in templating."
msgstr ""
"A classe pode ser usada para simular escopos aninhados e é útil em modelos."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:55
msgid ""
"A :class:`ChainMap` groups multiple dicts or other mappings together to "
"create a single, updateable view. If no *maps* are specified, a single "
"empty dictionary is provided so that a new chain always has at least one "
"mapping."
msgstr ""
"Um grupo de múltiplos dicts :class:`ChainMap` ou outros mapeamentos juntos "
"para criar uma única view atualizável. Se *maps* não são especificados, Um "
"diticionário vazio é fornecido para que uma nova cadeia sempre tenha pelo "
"menos um mapeamento."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:59
msgid ""
"The underlying mappings are stored in a list. That list is public and can "
"be accessed or updated using the *maps* attribute. There is no other state."
msgstr ""
"Os mapeamentos subjacentes são armazenados em uma lista. Essa lista é "
"pública e pode ser acessada ou atualizada usando o atributo * maps *. Não "
"existe outro estado."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:62
msgid ""
"Lookups search the underlying mappings successively until a key is found. "
"In contrast, writes, updates, and deletions only operate on the first "
"mapping."
msgstr ""
"Faz a busca nos mapeamentos subjacentes sucessivamente até que uma chave "
"seja encontrada. Em contraste, escrita, atualições e remoções operam apenas "
"no primeiro mapeamento."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:65
msgid ""
"A :class:`ChainMap` incorporates the underlying mappings by reference. So, "
"if one of the underlying mappings gets updated, those changes will be "
"reflected in :class:`ChainMap`."
msgstr ""
"Uma :class:`ChainMap` incorpora os mapeamentos subjacentes por referência. "
"Então, se um dos mapeamentos subjacentes for atualizado, essas alterações "
"serão refletidas em: class: `ChainMap`."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:69
msgid ""
"All of the usual dictionary methods are supported. In addition, there is a "
"*maps* attribute, a method for creating new subcontexts, and a property for "
"accessing all but the first mapping:"
msgstr ""
"Todos os métodos usuais do dicionário são suportados. Além disso, existe um "
"atributo *maps*, um método para criar novos subcontextos e uma propriedade "
"para acessar todos, exceto o primeiro mapeamento:"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:75
msgid ""
"A user updateable list of mappings. The list is ordered from first-searched "
"to last-searched. It is the only stored state and can be modified to change "
"which mappings are searched. The list should always contain at least one "
"mapping."
msgstr ""
"Uma lista de mapeamentos atualizáveis pelo usuário. A lista é ordenada desde "
"o primeiro pesquisado até a última pesquisado. É o único estado armazenado e "
"pode ser modificado para alterar quais mapeamentos são pesquisados. A lista "
"deve sempre conter pelo menos um mapeamento."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:82
msgid ""
"Returns a new :class:`ChainMap` containing a new map followed by all of the "
"maps in the current instance. If ``m`` is specified, it becomes the new map "
"at the front of the list of mappings; if not specified, an empty dict is "
"used, so that a call to ``d.new_child()`` is equivalent to: ``ChainMap({}, "
"*d.maps)``. This method is used for creating subcontexts that can be "
"updated without altering values in any of the parent mappings."
msgstr ""
"Retorna uma nova: class: 'ChainMap' contendo um novo mapa seguido de todos "
"os mapas na instância atual. Se ``m`` for especificado, torna-se o novo "
"mapa na frente da lista de mapeamentos; Se não especificado, é usado um "
"dicionário vazio, de modo que chamar ``d.new_child ()`` é equivalente a: "
"``ChainMap({}, *d.maps)``. Esse método é usado para criar subcontextos que "
"podem ser atualizados sem alterar valores em nenhum dos mapeamentos pai."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:90
msgid "The optional ``m`` parameter was added."
msgstr "O parâmetro opcional \"m\" foi adicionado."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:95
msgid ""
"Property returning a new :class:`ChainMap` containing all of the maps in the "
"current instance except the first one. This is useful for skipping the "
"first map in the search. Use cases are similar to those for the :keyword:"
"`nonlocal` keyword used in :term:`nested scopes <nested scope>`. The use "
"cases also parallel those for the built-in :func:`super` function. A "
"reference to ``d.parents`` is equivalent to: ``ChainMap(*d.maps[1:])``."
msgstr "<nested scope>"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:103
msgid ""
"Note, the iteration order of a :class:`ChainMap()` is determined by scanning "
"the mappings last to first::"
msgstr ""
"Observe, a ordem de iteração de um :class:`ChainMap()` é determinada pela "
"varredura dos mapeamentos do último ao primeiro::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:111
msgid ""
"This gives the same ordering as a series of :meth:`dict.update` calls "
"starting with the last mapping::"
msgstr ""
"Isso dá a mesma ordem de uma série de chamadas :meth:`dict.update` começando "
"com o último mapeamento::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:121
msgid ""
"The `MultiContext class <https://github.com/enthought/codetools/blob/4.0.0/"
"codetools/contexts/multi_context.py>`_ in the Enthought `CodeTools package "
"<https://github.com/enthought/codetools>`_ has options to support writing to "
"any mapping in the chain."
msgstr ""
"A `classe MultiContext <https://github.com/enthought/codetools/blob/4.0.0/"
"codetools/contexts/multi_context.py>`_ no `pacote CodeTools <https://github."
"com/enthought/codetools>`_ de Enthought tem opções para suportar a escrita "
"em qualquer mapeamento na cadeia."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:127
msgid ""
"Django's `Context class <https://github.com/django/django/blob/master/django/"
"template/context.py>`_ for templating is a read-only chain of mappings. It "
"also features pushing and popping of contexts similar to the :meth:"
"`~collections.ChainMap.new_child` method and the :attr:`~collections."
"ChainMap.parents` property."
msgstr ""
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:134
msgid ""
"The `Nested Contexts recipe <https://code.activestate.com/recipes/577434/>`_ "
"has options to control whether writes and other mutations apply only to the "
"first mapping or to any mapping in the chain."
msgstr ""
"A `receita de Contextos Aninhados <https://code.activestate.com/"
"recipes/577434/>`_ possui opções para controlar se escritas e outras "
"mutações se aplicam a apenas o primeiro mapeamento ou para qualquer "
"mapeamento na cadeia."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:139
msgid ""
"A `greatly simplified read-only version of Chainmap <https://code."
"activestate.com/recipes/305268/>`_."
msgstr "Uma versão muito simplificada somente leitura do Chainmap."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:144
msgid ":class:`ChainMap` Examples and Recipes"
msgstr "Exemplos e Receitas de :class:`ChainMap`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:146
msgid "This section shows various approaches to working with chained maps."
msgstr ""
"Esta seção mostra várias abordagens para trabalhar com mapas encadeados."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:149
msgid "Example of simulating Python's internal lookup chain::"
msgstr "Exemplo de simulação da cadeia de busca interna do Python::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:154
msgid ""
"Example of letting user specified command-line arguments take precedence "
"over environment variables which in turn take precedence over default "
"values::"
msgstr ""
"Exemplo de como permitir que os argumentos de linha de comando especificados "
"pelo usuário tenham precedência sobre as variáveis de ambiente que, por sua "
"vez, têm precedência sobre os valores padrão::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:171
msgid ""
"Example patterns for using the :class:`ChainMap` class to simulate nested "
"contexts::"
msgstr ""
"Padrões de exemplo para utilização da classe :class:`ChainMap` para simular "
"contextos aninhados::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:190
msgid ""
"The :class:`ChainMap` class only makes updates (writes and deletions) to the "
"first mapping in the chain while lookups will search the full chain. "
"However, if deep writes and deletions are desired, it is easy to make a "
"subclass that updates keys found deeper in the chain::"
msgstr ""
"A classe :class:`ChainMap` só faz atualizações (escritas e remoções) no "
"primeiro mapeamento na cadeia, enquanto as pesquisas irão buscar em toda a "
"cadeia. Contudo, se há o desejo de escritas e remoções profundas, é fácil "
"fazer uma subclasse que atualiza chaves encontradas mais a fundo na cadeia::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:221
msgid ":class:`Counter` objects"
msgstr "Objetos :class:`Counter`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:223
msgid ""
"A counter tool is provided to support convenient and rapid tallies. For "
"example::"
msgstr ""
"Uma ferramenta de contagem é fornecida para apoiar contas rápidas e "
"convenientes. Por exemplo::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:242
msgid ""
"A :class:`Counter` is a :class:`dict` subclass for counting hashable "
"objects. It is a collection where elements are stored as dictionary keys and "
"their counts are stored as dictionary values. Counts are allowed to be any "
"integer value including zero or negative counts. The :class:`Counter` class "
"is similar to bags or multisets in other languages."
msgstr ""
"Um :class:`Counter` é uma subclasse de :class:`dict` subclass para contagem "
"de objetos hasheáveis. É uma coleção na qual elementos são armazenados como "
"chaves de dicionários e suas contagens são armazenadas como valores de "
"dicionário. Contagens podem ser qualquer valor inteiro incluindo zero e "
"contagens negativas. A classe :class:`Counter` é similar a sacos ou "
"multiconjuntos em outras linguagens."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:248
msgid ""
"Elements are counted from an *iterable* or initialized from another "
"*mapping* (or counter):"
msgstr ""
"Os elementas são contados a partir de um *iterável* ou inicializado a partir "
"de um outro *mapeamento* (ou contador):"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:256
msgid ""
"Counter objects have a dictionary interface except that they return a zero "
"count for missing items instead of raising a :exc:`KeyError`:"
msgstr ""
"Objetos Counter tem uma interface de dicionário, com a diferença que "
"devolvem uma contagem zero para itens que não estão presentes em vez de "
"levantar a excessão :exc:`KeyError`:"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:263
msgid ""
"Setting a count to zero does not remove an element from a counter. Use "
"``del`` to remove it entirely:"
msgstr ""
"Definir uma contagem como zero não remove um elemento do contador. Use "
"``del`` para o remover completamente."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:272
msgid ""
"Counter objects support three methods beyond those available for all "
"dictionaries:"
msgstr ""
"Objetos Counter permitem três métodos além dos disponíveis para todos os "
"dicionário:"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:277
msgid ""
"Return an iterator over elements repeating each as many times as its count. "
"Elements are returned in arbitrary order. If an element's count is less "
"than one, :meth:`elements` will ignore it."
msgstr ""
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:287
msgid ""
"Return a list of the *n* most common elements and their counts from the most "
"common to the least. If *n* is omitted or ``None``, :meth:`most_common` "
"returns *all* elements in the counter. Elements with equal counts are "
"ordered arbitrarily:"
msgstr ""
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:297
msgid ""
"Elements are subtracted from an *iterable* or from another *mapping* (or "
"counter). Like :meth:`dict.update` but subtracts counts instead of "
"replacing them. Both inputs and outputs may be zero or negative."
msgstr ""
"Os elementos são subtraídos de um *iterável* ou de outro *mapeamento* (ou "
"contador). Funciona como :meth:`dict.update`, mas subtraindo contagens ao "
"invés de substituí-las. Tanto as entradas quanto as saídas podem ser zero "
"ou negativas."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:309
msgid ""
"The usual dictionary methods are available for :class:`Counter` objects "
"except for two which work differently for counters."
msgstr ""
"Os métodos usuais de dicionário estão disponíveis para objetos :class:"
"`Counter`, exceto por dois que funcionam de forma diferente para contadores."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:314
msgid "This class method is not implemented for :class:`Counter` objects."
msgstr ""
"Este método de classe não está implementado para objetos :class:`Counter`."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:318
msgid ""
"Elements are counted from an *iterable* or added-in from another *mapping* "
"(or counter). Like :meth:`dict.update` but adds counts instead of replacing "
"them. Also, the *iterable* is expected to be a sequence of elements, not a "
"sequence of ``(key, value)`` pairs."
msgstr ""
"Elementos são contados a partir de um *iterável* ou adicionados de outro "
"*mapeamento* (ou contador). Funciona como :meth:`dict.update` mas adiciona "
"contagens em vez de substituí-las. Além disso, é esperado que o *iterável* "
"seja uma sequência de elementos, e não uma sequência de pares ``(key, "
"value)``."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:323
msgid "Common patterns for working with :class:`Counter` objects::"
msgstr "Padrões comuns para trabalhar com objetos :class:`Counter`::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:335
msgid ""
"Several mathematical operations are provided for combining :class:`Counter` "
"objects to produce multisets (counters that have counts greater than zero). "
"Addition and subtraction combine counters by adding or subtracting the "
"counts of corresponding elements. Intersection and union return the minimum "
"and maximum of corresponding counts. Each operation can accept inputs with "
"signed counts, but the output will exclude results with counts of zero or "
"less."
msgstr ""
"Várias operações matemáticas são fornecidas para combinar: class: objetos "
"`Counter` para produzir multisets (counters que têm contagens maiores que "
"zero). A adição e a subtração combinam counters adicionando ou subtraindo as "
"contagens dos elementos correspondentes. A intersecção e a união retornam o "
"mínimo e o máximo das contagens correspondentes. Cada operação pode aceitar "
"entradas com contagens assinadas, mas a saída excluirá resultados com "
"contagens de zero ou menos."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:353
msgid ""
"Unary addition and subtraction are shortcuts for adding an empty counter or "
"subtracting from an empty counter."
msgstr ""
"A adição e subtração unárias são atalhos para adicionar um contador vazio ou "
"subtrair de um contador vazio."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:362
msgid ""
"Added support for unary plus, unary minus, and in-place multiset operations."
msgstr ""
"Adicionado suporte para operador unário mais, unário menos e operação in-"
"place multiset."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:367
msgid ""
"Counters were primarily designed to work with positive integers to represent "
"running counts; however, care was taken to not unnecessarily preclude use "
"cases needing other types or negative values. To help with those use cases, "
"this section documents the minimum range and type restrictions."
msgstr ""
"Os contadores foram projetados principalmente para funcionar com números "
"inteiros positivos para representar contagens contínuas; no entanto, foi "
"tomado cuidado para não impedir desnecessariamente os casos de uso que "
"precisassem de outros tipos ou valores negativos. Para ajudar nesses casos "
"de uso, esta seção documenta o intervalo mínimo e as restrições de tipo."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:372
msgid ""
"The :class:`Counter` class itself is a dictionary subclass with no "
"restrictions on its keys and values. The values are intended to be numbers "
"representing counts, but you *could* store anything in the value field."
msgstr ""
"A própria classe :class:`Counter` é uma subclasse de dicionário sem "
"restrições em suas chaves e valores. Os valores pretendem ser números que "
"representam contagens, mas você *pode* armazenar qualquer coisa no campo de "
"valor."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:376
msgid ""
"The :meth:`~Counter.most_common` method requires only that the values be "
"orderable."
msgstr ""
"O método :meth:`~Counter.most_common` requer apenas que os valores sejam "
"ordenáveis."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:378
msgid ""
"For in-place operations such as ``c[key] += 1``, the value type need only "
"support addition and subtraction. So fractions, floats, and decimals would "
"work and negative values are supported. The same is also true for :meth:"
"`~Counter.update` and :meth:`~Counter.subtract` which allow negative and "
"zero values for both inputs and outputs."
msgstr ""
"Para operações in-place, como ``c[key] += 1``, o tipo de valor precisa "
"suportar apenas adição e subtração. Portanto, frações, números de ponto "
"flutuante e decimais funcionariam e os valores negativos são suportados. O "
"mesmo também é verdadeiro para: meth: `~ Counter.update` e: meth:` ~ Counter."
"subtract` que permitem valores negativos e zero para entradas e saídas."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:384
msgid ""
"The multiset methods are designed only for use cases with positive values. "
"The inputs may be negative or zero, but only outputs with positive values "
"are created. There are no type restrictions, but the value type needs to "
"support addition, subtraction, and comparison."
msgstr ""
"Os métodos multiset são projetados apenas para casos de uso com valores "
"positivos. As entradas podem ser negativas ou zero, mas apenas saídas com "
"valores positivos são criadas. Não há restrições de tipo, mas o tipo de "
"valor precisa suportar adição, subtração e comparação."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:389
msgid ""
"The :meth:`~Counter.elements` method requires integer counts. It ignores "
"zero and negative counts."
msgstr ""
"O método: meth: `~ Counter.elements` requer contadores inteiros. Ele ignora "
"contadores zero e negativos."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:394
msgid ""
"`Bag class <https://www.gnu.org/software/smalltalk/manual-base/html_node/Bag."
"html>`_ in Smalltalk."
msgstr ""
"Classe Bag <https://www.gnu.org/software/smalltalk/manual-base/html_node/Bag."
"html> `_ em Smalltalk."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:397
msgid ""
"Wikipedia entry for `Multisets <https://en.wikipedia.org/wiki/Multiset>`_."
msgstr ""
"Entrada da Wikipedia para `Multisets <https://en.wikipedia.org/wiki/"
"Multiset>` _."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:399
msgid ""
"`C++ multisets <http://www.java2s.com/Tutorial/Cpp/0380__set-multiset/"
"Catalog0380__set-multiset.htm>`_ tutorial with examples."
msgstr ""
"Tutorial com exemplos `C++ multisets <http://www.java2s.com/Tutorial/"
"Cpp/0380__set-multiset/Catalog0380__set-multiset.htm>`_."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:402
msgid ""
"For mathematical operations on multisets and their use cases, see *Knuth, "
"Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise "
"19*."
msgstr ""
"Para operações matemáticas em multisets e seus casos de uso, consulte * "
"Knuth, Donald. The Art of Computer Programming Volume II, Seção 4.6.3, "
"Exercício 19 *."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:406
msgid ""
"To enumerate all distinct multisets of a given size over a given set of "
"elements, see :func:`itertools.combinations_with_replacement`::"
msgstr ""
"Para enumerar todos os multisets distintos de um determinado tamanho em um "
"determinado conjunto de elementos, consulte: func:` itertools."
"combinations_with_replacement` ::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:413
msgid ":class:`deque` objects"
msgstr "Objetos :class:`deque`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:417
msgid ""
"Returns a new deque object initialized left-to-right (using :meth:`append`) "
"with data from *iterable*. If *iterable* is not specified, the new deque is "
"empty."
msgstr ""
"Retorna um novo objeto deque inicializado da esquerda para a direita "
"(usando: meth: `append`) com dados de * iterável *. Se * iterável * não for "
"especificado, o novo deque estará vazio."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:420
msgid ""
"Deques are a generalization of stacks and queues (the name is pronounced "
"\"deck\" and is short for \"double-ended queue\"). Deques support thread-"
"safe, memory efficient appends and pops from either side of the deque with "
"approximately the same O(1) performance in either direction."
msgstr ""
"Deques são uma generalização de pilhas e filas (o nome é pronunciado "
"\"deck\" e é abreviação de \"fila dupla\"). O Deques oferece suporte para "
"acréscimos e saliências com segurança de thread e com eficiência de memória "
"de ambos os lados do deque com aproximadamente o mesmo desempenho O (1) em "
"qualquer direção."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:425
msgid ""
"Though :class:`list` objects support similar operations, they are optimized "
"for fast fixed-length operations and incur O(n) memory movement costs for "
"``pop(0)`` and ``insert(0, v)`` operations which change both the size and "
"position of the underlying data representation."
msgstr ""
"Embora os objetos: class: `list` suportem operações semelhantes, eles são "
"otimizados para operações rápidas de comprimento fixo e sujeitam em custos "
"de movimentação de memória O (n) para` `pop (0)` `e` `insert (0, v)` ` "
"operações que alteram o tamanho e a posição da representação de dados "
"subjacente."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:431
msgid ""
"If *maxlen* is not specified or is ``None``, deques may grow to an arbitrary "
"length. Otherwise, the deque is bounded to the specified maximum length. "
"Once a bounded length deque is full, when new items are added, a "
"corresponding number of items are discarded from the opposite end. Bounded "
"length deques provide functionality similar to the ``tail`` filter in Unix. "
"They are also useful for tracking transactions and other pools of data where "
"only the most recent activity is of interest."
msgstr ""
"Se * maxlen * não for especificado ou for `` Nenhum``, deques podem crescer "
"para um comprimento arbitrário. Caso contrário, o deque é limitado ao "
"comprimento máximo especificado. Quando um deque de comprimento limitado "
"está cheio, quando novos itens são adicionados, um número correspondente de "
"itens é descartado da extremidade oposta. Deques de comprimento limitado "
"fornecem funcionalidade semelhante ao filtro `` tail`` no Unix. Eles também "
"são úteis para rastrear transações e outros pools de dados onde apenas a "
"atividade mais recente é de interesse."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:440
msgid "Deque objects support the following methods:"
msgstr "Os objetos Deque suportam os seguintes métodos:"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:444
msgid "Add *x* to the right side of the deque."
msgstr "Adicione * x * ao lado direito do deque."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:449
msgid "Add *x* to the left side of the deque."
msgstr "Adicione * x * ao lado esquerdo do deque"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:454
msgid "Remove all elements from the deque leaving it with length 0."
msgstr "Remova todos os elementos do deque deixando-o com comprimento 0."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:459
msgid "Create a shallow copy of the deque."
msgstr "Cria uma cópia rasa do deque."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:466
msgid "Count the number of deque elements equal to *x*."
msgstr "Conta o número de elementos deque igual a * x *."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:473
msgid ""
"Extend the right side of the deque by appending elements from the iterable "
"argument."
msgstr ""
"Estenda o lado direito do deque anexando elementos do argumento iterável."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:479
msgid ""
"Extend the left side of the deque by appending elements from *iterable*. "
"Note, the series of left appends results in reversing the order of elements "
"in the iterable argument."
msgstr ""
"Estenda o lado esquerdo do deque anexando elementos de *iterable*. Observe "
"que a série de acréscimos à esquerda resulta na reversão da ordem dos "
"elementos no argumento iterável."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:486
msgid ""
"Return the position of *x* in the deque (at or after index *start* and "
"before index *stop*). Returns the first match or raises :exc:`ValueError` "
"if not found."
msgstr ""
"Retorne a posição de * x * no deque (no ou após o índice * início * e antes "
"do índice * parada *). Retorna a primeira correspondência ou aumenta: exc: "
"`ValueError` se não for encontrado."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:495
msgid "Insert *x* into the deque at position *i*."
msgstr "Insira * x * no deque na posição * i *."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:497
msgid ""
"If the insertion would cause a bounded deque to grow beyond *maxlen*, an :"
"exc:`IndexError` is raised."
msgstr ""
"Se a inserção fizer com que um deque limitado cresça além de * maxlen *, um: "
"exc: `IndexError` é gerado."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:505
msgid ""
"Remove and return an element from the right side of the deque. If no "
"elements are present, raises an :exc:`IndexError`."
msgstr ""
"Remova e devolva um elemento do lado direito do deque. Se nenhum elemento "
"estiver presente, levanta um: exc: `IndexError`."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:511
msgid ""
"Remove and return an element from the left side of the deque. If no elements "
"are present, raises an :exc:`IndexError`."
msgstr ""
"Remova e devolva um elemento do lado esquerdo do deque. Se nenhum elemento "
"estiver presente, levanta um: exc: `IndexError`."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:517
msgid ""
"Remove the first occurrence of *value*. If not found, raises a :exc:"
"`ValueError`."
msgstr ""
"Remova a primeira ocorrência de * valor *. Se não for encontrado, levanta "
"um: exc: `ValueError`."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:523
msgid "Reverse the elements of the deque in-place and then return ``None``."
msgstr ""
"Inverta os elementos do deque no local e, em seguida, retorne ``None``."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:530
msgid ""
"Rotate the deque *n* steps to the right. If *n* is negative, rotate to the "
"left."
msgstr ""
"Gire os passos deque * n * para a direita. Se * n * for negativo, gire para "
"a esquerda."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:533
msgid ""
"When the deque is not empty, rotating one step to the right is equivalent to "
"``d.appendleft(d.pop())``, and rotating one step to the left is equivalent "
"to ``d.append(d.popleft())``."
msgstr ""
"Quando o deque não está vazio, girar um passo para a direita é equivalente a "
"``d.appendleft(d.pop())``, e girar um passo para a esquerda é equivalente a "
"``d.append(d.popleft())``."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:538
msgid "Deque objects also provide one read-only attribute:"
msgstr "Os objetos Deque também fornecem um atributo somente leitura:"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:542
msgid "Maximum size of a deque or ``None`` if unbounded."
msgstr "Tamanho máximo de um deque ou ``None`` se ilimitado."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:547
msgid ""
"In addition to the above, deques support iteration, pickling, ``len(d)``, "
"``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing "
"with the :keyword:`in` operator, and subscript references such as "
"``d[-1]``. Indexed access is O(1) at both ends but slows to O(n) in the "
"middle. For fast random access, use lists instead."
msgstr ""
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:553
msgid ""
"Starting in version 3.5, deques support ``__add__()``, ``__mul__()``, and "
"``__imul__()``."
msgstr ""
"A partir da versão 3.5, deques suporta `` __add __ () ``, `` __mul __ () `` "
"e `` __imul __ () ``."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:556
msgid "Example:"
msgstr "Exemplo:"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:613
msgid ":class:`deque` Recipes"
msgstr "Receitas de :class:`deque`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:615
msgid "This section shows various approaches to working with deques."
msgstr "Esta seção mostra várias abordagens para trabalhar com deques."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:617
msgid ""
"Bounded length deques provide functionality similar to the ``tail`` filter "
"in Unix::"
msgstr ""
"Deques de comprimento limitado fornecem funcionalidade semelhante ao filtro "
"``tail`` em Unix ::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:625
msgid ""
"Another approach to using deques is to maintain a sequence of recently added "
"elements by appending to the right and popping to the left::"
msgstr ""
"Outra abordagem para usar deques é manter uma sequência de elementos "
"adicionados recentemente, acrescentando à direita e clicando à esquerda::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:640
msgid ""
"A `round-robin scheduler <https://en.wikipedia.org/wiki/Round-"
"robin_scheduling>`_ can be implemented with input iterators stored in a :"
"class:`deque`. Values are yielded from the active iterator in position "
"zero. If that iterator is exhausted, it can be removed with :meth:`~deque."
"popleft`; otherwise, it can be cycled back to the end with the :meth:`~deque."
"rotate` method::"
msgstr ""
"Um `escalonador round-robin <https://en.wikipedia.org/wiki/Round-"
"robin_scheduling>` _ pode ser implementado com iteradores de entrada "
"armazenados em um: class: `deque`. Os valores são gerados a partir do "
"iterador ativo na posição zero. Se esse iterador estiver esgotado, ele pode "
"ser removido com: meth: `~ deque.popleft`; caso contrário, ele pode voltar "
"ao fim com o método: meth: `~ deque.rotate` ::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:659
msgid ""
"The :meth:`~deque.rotate` method provides a way to implement :class:`deque` "
"slicing and deletion. For example, a pure Python implementation of ``del "
"d[n]`` relies on the ``rotate()`` method to position elements to be popped::"
msgstr ""
"O método: meth: `~ deque.rotate` fornece uma maneira de implementar o corte "
"e exclusão: class:` deque`. Por exemplo, uma implementação Python pura de "
"``del d[n]`` depende do método ``rotate()`` para posicionar os elementos a "
"serem popped ::"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:668
msgid ""
"To implement :class:`deque` slicing, use a similar approach applying :meth:"
"`~deque.rotate` to bring a target element to the left side of the deque. "
"Remove old entries with :meth:`~deque.popleft`, add new entries with :meth:"
"`~deque.extend`, and then reverse the rotation. With minor variations on "
"that approach, it is easy to implement Forth style stack manipulations such "
"as ``dup``, ``drop``, ``swap``, ``over``, ``pick``, ``rot``, and ``roll``."
msgstr ""
"Para implementar o corte: class: `deque`, use uma abordagem semelhante "
"aplicando: meth:` ~ deque.rotate` para trazer um elemento alvo para o lado "
"esquerdo do deque. Remova as entradas antigas com: meth: `~ deque.popleft`, "
"adicione novas entradas com: meth:` ~ deque.extend`, e então inverta a "
"rotação. Com pequenas variações dessa abordagem, é fácil implementar "
"manipulações de pilha de estilo Forth, como ``dup``,``drop``,``swap``,"
"``over``,``pick``,``rot``, and ``roll``."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:678
msgid ":class:`defaultdict` objects"
msgstr "Objetos :class:`defaultdict`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:682
msgid ""
"Returns a new dictionary-like object. :class:`defaultdict` is a subclass of "
"the built-in :class:`dict` class. It overrides one method and adds one "
"writable instance variable. The remaining functionality is the same as for "
"the :class:`dict` class and is not documented here."
msgstr ""
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:687
msgid ""
"The first argument provides the initial value for the :attr:"
"`default_factory` attribute; it defaults to ``None``. All remaining "
"arguments are treated the same as if they were passed to the :class:`dict` "
"constructor, including keyword arguments."
msgstr ""
"O primeiro argumento fornece o valor inicial para o atributo: attr: "
"`default_factory`; o padrão é `` Nenhum``. Todos os argumentos restantes são "
"tratados da mesma forma como se fossem passados para o construtor: class: "
"`dict`, incluindo argumentos de palavra-chave."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:693
msgid ""
":class:`defaultdict` objects support the following method in addition to the "
"standard :class:`dict` operations:"
msgstr ""
"Os objetos: class: `defaultdict` suportam o seguinte método além das "
"operações padrão: class:` dict`:"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:698
msgid ""
"If the :attr:`default_factory` attribute is ``None``, this raises a :exc:"
"`KeyError` exception with the *key* as argument."
msgstr ""
"Se o atributo: attr: `default_factory` é ``None``, isso levanta uma exceção: "
"exc:` KeyError` com a * chave * como argumento."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:701
msgid ""
"If :attr:`default_factory` is not ``None``, it is called without arguments "
"to provide a default value for the given *key*, this value is inserted in "
"the dictionary for the *key*, and returned."
msgstr ""
"Se: attr: `default_factory` não for ``None``, ele é chamado sem argumentos "
"para fornecer um valor padrão para a * chave * fornecida, este valor é "
"inserido no dicionário para a * chave * e retornado."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:705
msgid ""
"If calling :attr:`default_factory` raises an exception this exception is "
"propagated unchanged."
msgstr ""
"Se chamar: attr: `default_factory` levanta uma exceção, esta exceção é "
"propagada inalterada."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:708
msgid ""
"This method is called by the :meth:`__getitem__` method of the :class:`dict` "
"class when the requested key is not found; whatever it returns or raises is "
"then returned or raised by :meth:`__getitem__`."
msgstr ""
"Este método é chamado pelo método: meth: `__getitem__` da classe: class:` "
"dict` quando a chave solicitada não é encontrada; tudo o que ele retorna ou "
"aumenta é então retornado ou gerado por: meth: `__getitem__`."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:712
msgid ""
"Note that :meth:`__missing__` is *not* called for any operations besides :"
"meth:`__getitem__`. This means that :meth:`get` will, like normal "
"dictionaries, return ``None`` as a default rather than using :attr:"
"`default_factory`."
msgstr ""
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:718
msgid ":class:`defaultdict` objects support the following instance variable:"
msgstr "Objetos :class:`defaultdict` permitem a seguinte variável instanciada:"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:723
msgid ""
"This attribute is used by the :meth:`__missing__` method; it is initialized "
"from the first argument to the constructor, if present, or to ``None``, if "
"absent."
msgstr ""
"Este atributo é usado pelo método :meth:`__missing__`; ele é inicializado a "
"partir do primeiro argumento para o construtor, se presente, ou para "
"``None``, se ausente."
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:729
msgid ":class:`defaultdict` Examples"
msgstr "Exemplos de :class:`defaultdict`"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:731
msgid ""
"Using :class:`list` as the :attr:`~defaultdict.default_factory`, it is easy "
"to group a sequence of key-value pairs into a dictionary of lists:"
msgstr ""
"Usando :class:`list` como :attr:`~defaultdict.default_factory`, se for fácil "
"agrupar a sequencia dos pares chave-valores num dicionário de listas"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:742
msgid ""
"When each key is encountered for the first time, it is not already in the "
"mapping; so an entry is automatically created using the :attr:`~defaultdict."
"default_factory` function which returns an empty :class:`list`. The :meth:"
"`list.append` operation then attaches the value to the new list. When keys "
"are encountered again, the look-up proceeds normally (returning the list for "
"that key) and the :meth:`list.append` operation adds another value to the "
"list. This technique is simpler and faster than an equivalent technique "
"using :meth:`dict.setdefault`:"
msgstr ""
"Quando cada chave é encontrada pela primeira vez, ela ainda não está no "
"mapeamento; então uma entrada é criada automaticamente usando a função :attr:"
"`~defaultdict.default_factory` que retorna uma :class:`list` vazia. A "
"operação :meth:`list.append` então anexa o valor à nova lista. Quando as "
"chaves são encontradas novamente, a pesquisa prossegue normalmente "
"(retornando a lista daquela chave) e a operação :meth:`list.append` adiciona "
"outro valor à lista. Esta técnica é mais simples e rápida que uma técnica "
"equivalente usando :meth:`dict.setdefault`:"
#: /home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/library/collections.rst:757
msgid ""
"Setting the :attr:`~defaultdict.default_factory` to :class:`int` makes the :"
"class:`defaultdict` useful for counting (like a bag or multiset in other "
"languages):"
msgstr ""