-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathcollections.po
More file actions
1378 lines (1134 loc) · 112 KB
/
Copy pathcollections.po
File metadata and controls
1378 lines (1134 loc) · 112 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 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Alireza Shabani (Revisto) <theRevisto@gmail.com>, 2025
# Rafael Fontenelle <rffontenelle@gmail.com>, 2025
# Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-21 11:59+0000\n"
"PO-Revision-Date: 2026-09-14 10:44+0330\n"
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
"Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.6\n"
msgid ":mod:`!collections` --- Container datatypes"
msgstr ":mod:`!collections` --- انواع دادهی ظرف"
msgid "**Source code:** :source:`Lib/collections/__init__.py`"
msgstr "**کد منبع:** :source:`Lib/collections/__init__.py`"
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 "این ماژول انواع دادهی ظرف تخصصی را پیادهسازی میکند و جایگزینهایی برای ظرفهای توکار عمومی پایتون، :class:`dict`، :class:`list`، :class:`set` و :class:`tuple` فراهم میکند."
msgid ":func:`namedtuple`"
msgstr ":func:`namedtuple`"
msgid "factory function for creating tuple subclasses with named fields"
msgstr "تابع کارخانهای (factory function) برای ایجاد زیرکلاسهای تاپل با فیلدهای نامدار"
msgid ":class:`deque`"
msgstr ":class:`deque`"
msgid "list-like container with fast appends and pops on either end"
msgstr "ظرفی فهرستمانند با امکان افزودن و برداشتن سریع در هر دو انتها"
msgid ":class:`ChainMap`"
msgstr ":class:`ChainMap`"
msgid "dict-like class for creating a single view of multiple mappings"
msgstr "کلاس دیکشنریمانند برای ایجاد یک نمای واحد از چندین نگاشت"
msgid ":class:`Counter`"
msgstr ":class:`Counter`"
msgid "dict subclass for counting :term:`hashable` objects"
msgstr "زیرکلاس دیکشنری برای شمارش اشیاء :term:`hashable`"
msgid ":class:`OrderedDict`"
msgstr ":class:`OrderedDict`"
msgid "dict subclass that remembers the order entries were added"
msgstr "زیرکلاسی از dict که ترتیب افزوده شدن آیتمها را به خاطر میسپارد"
msgid ":class:`defaultdict`"
msgstr ":class:`defaultdict`"
msgid "dict subclass that calls a factory function to supply missing values"
msgstr "زیرکلاس dict که برای تأمین مقادیر گمشده، یک تابع کارخانه را فراخوانی میکند"
msgid ":class:`UserDict`"
msgstr ":class:`UserDict`"
msgid "wrapper around dictionary objects for easier dict subclassing"
msgstr "پوششی دور اشیای دیکشنری برای زیرکلاسسازی آسانتر از dict"
msgid ":class:`UserList`"
msgstr ":class:`UserList`"
msgid "wrapper around list objects for easier list subclassing"
msgstr "پوششی بر روی اشیای فهرست برای زیرکلاسسازی آسانتر فهرست"
msgid ":class:`UserString`"
msgstr ":class:`UserString`"
msgid "wrapper around string objects for easier string subclassing"
msgstr "پوششی بر روی اشیاء رشتهای برای زیرکلاسسازی آسانتر از رشته"
msgid ":class:`ChainMap` objects"
msgstr "اشیاء :class:`ChainMap`"
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 "کلاس :class:`ChainMap` برای پیوند سریع تعدادی نگاشت فراهم شده است تا بتوان با آنها بهعنوان یک واحد رفتار کرد. این کار اغلب بسیار سریعتر از ایجاد یک دیکشنری جدید و اجرای چندین فراخوانی :meth:`~dict.update` است."
msgid "The class can be used to simulate nested scopes and is useful in templating."
msgstr "این کلاس میتواند برای شبیهسازی محدودههای تودرتو استفاده شود و در قالببندی مفید است."
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 "یک :class:`ChainMap` چندین دیکشنری یا نگاشتهای دیگر را در کنار هم قرار میدهد تا یک نمای واحد و بهروزرسانیپذیر ایجاد کند. اگر هیچ *maps* مشخص نشده باشد، یک دیکشنری خالی ارائه میشود تا یک زنجیره جدید همیشه حداقل یک نگاشت داشته باشد."
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 "نگاشتهای زیربنایی در یک فهرست ذخیره میشوند. آن فهرست عمومی است و میتوان با استفاده از ویژگی *maps* به آن دسترسی پیدا کرد یا آن را بهروزرسانی کرد. هیچ وضعیت دیگری وجود ندارد."
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 "جستوجوها نگاشتهای زیرین را بهترتیب جستوجو میکنند تا کلیدی پیدا شود. در مقابل، نوشتنها، بهروزرسانیها و حذفها تنها روی اولین نگاشت عمل میکنند."
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 "یک :class:`ChainMap` نگاشتهای زیربنایی را بهصورت ارجاعی در بر میگیرد. بنابراین، اگر یکی از نگاشتهای زیربنایی بهروزرسانی شود، آن تغییرات در :class:`ChainMap` منعکس خواهند شد."
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 "تمام متدهای معمول دیکشنری پشتیبانی میشوند. علاوه بر این، یک ویژگی *maps*، یک متد برای ایجاد زیرزمینههای جدید، و یک پراپرتی برای دسترسی به همه نگاشتها بهجز اولین نگاشت وجود دارد:"
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 "فهرستی از نگاشتها که کاربر میتواند آن را بهروزرسانی کند. این فهرست به ترتیب از نخستین مورد جستجوشده تا آخرین مورد جستجوشده مرتب شده است. این تنها وضعیت ذخیرهشده است و میتوان آن را برای تغییر نگاشتهایی که جستجو میشوند، تغییر داد. این فهرست باید همواره شامل دستکم یک نگاشت باشد."
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)``. If any keyword arguments are specified, they update passed map or new empty dict. This method is used for creating subcontexts that can be updated without altering values in any of the parent mappings."
msgstr "یک :class:`ChainMap` جدید برمیگرداند که شامل یک نگاشت جدید و به دنبال آن همهی نگاشتهای موجود در نمونه فعلی است. اگر ``m`` مشخص شده باشد، نگاشت جدید در ابتدای فهرست نگاشتها قرار میگیرد؛ اگر مشخص نشده باشد، از یک دیکشنری خالی استفاده میشود، بهطوری که فراخوانی ``d.new_child()`` معادل ``ChainMap({}, *d.maps)`` است. اگر آرگومانهای کلیدواژهای مشخص شده باشند، آنها نگاشت دادهشده یا دیکشنری خالی جدید را بهروزرسانی میکنند. این متد برای ایجاد زیرزمینههایی استفاده میشود که میتوانند بدون تغییر مقادیر هیچیک از نگاشتهای والد بهروزرسانی شوند."
msgid "The optional ``m`` parameter was added."
msgstr "پارامتر اختیاری ``m`` اضافه شد."
msgid "Keyword arguments support was added."
msgstr "پشتیبانی از آرگومانهای کلیدواژهای افزوده شد."
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 "ویژگیای که یک :class:`ChainMap` جدید حاوی همهی نگاشتهای موجود در نمونهی جاری، بهجز اولین آنها را برمیگرداند. این ویژگی برای پرش از اولین نگاشت در جستجو مفید است. موارد استفاده مشابه موارد استفادهی کلیدواژهی :keyword:`nonlocal` است که در :term:`محدودههای تودرتو <nested scope>` استفاده میشود. این موارد استفاده همچنین مشابه موارد استفادهی تابع توکار :func:`super` است. ارجاع به ``d.parents`` معادل است با: ``ChainMap(*d.maps[1:])``."
msgid "Note, the iteration order of a :class:`ChainMap` is determined by scanning the mappings last to first::"
msgstr "توجه داشته باشید که ترتیب تکرار یک :class:`ChainMap` با پیمایش نگاشتها از آخر به اول تعیین میشود::"
msgid ""
">>> baseline = {'music': 'bach', 'art': 'rembrandt'}\n"
">>> adjustments = {'art': 'van gogh', 'opera': 'carmen'}\n"
">>> list(ChainMap(adjustments, baseline))\n"
"['music', 'art', 'opera']"
msgstr ""
">>> baseline = {'music': 'bach', 'art': 'rembrandt'}\n"
">>> adjustments = {'art': 'van gogh', 'opera': 'carmen'}\n"
">>> list(ChainMap(adjustments, baseline))\n"
"['music', 'art', 'opera']"
msgid "This gives the same ordering as a series of :meth:`dict.update` calls starting with the last mapping::"
msgstr "این همان ترتیبی را میدهد که یک دنباله از فراخوانیهای :meth:`dict.update` با شروع از آخرین نگاشت دارد::"
msgid ""
">>> combined = baseline.copy()\n"
">>> combined.update(adjustments)\n"
">>> list(combined)\n"
"['music', 'art', 'opera']"
msgstr ""
">>> combined = baseline.copy()\n"
">>> combined.update(adjustments)\n"
">>> list(combined)\n"
"['music', 'art', 'opera']"
msgid "Added support for ``|`` and ``|=`` operators, specified in :pep:`584`."
msgstr "پشتیبانی از عملگرهای ``|`` و ``|=`` که در :pep:`584` مشخص شدهاند، افزوده شد."
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 "`کلاس MultiContext <https://github.com/enthought/codetools/blob/4.0.0/codetools/contexts/multi_context.py>`_ در `بسته CodeTools <https://github.com/enthought/codetools>`_ از Enthought، گزینههایی برای پشتیبانی از نوشتن در هر نگاشتی در زنجیره دارد."
msgid "Django's `Context class <https://github.com/django/django/blob/main/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 "`کلاس Context <https://github.com/django/django/blob/main/django/template/context.py>`_ جنگو برای قالببندی، زنجیرهای فقطخواندنی از نگاشتها است. این کلاس همچنین امکان افزودن و برداشتن زمینهها را، مشابه متد :meth:`~collections.ChainMap.new_child` و ویژگی :attr:`~collections.ChainMap.parents`، فراهم میکند."
msgid "The `Nested Contexts recipe <https://code.activestate.com/recipes/577434-nested-contexts-a-chain-of-mapping-objects/>`_ has options to control whether writes and other mutations apply only to the first mapping or to any mapping in the chain."
msgstr "`Nested Contexts recipe <https://code.activestate.com/recipes/577434-nested-contexts-a-chain-of-mapping-objects/>`_ گزینههایی برای کنترل اینکه نوشتها و سایر تغییرات فقط بر اولین نگاشت اعمال شوند یا بر هر نگاشتی در زنجیره دارد."
msgid "A `greatly simplified read-only version of Chainmap <https://code.activestate.com/recipes/305268/>`_."
msgstr "یک `نسخه فقطخواندنی و بسیار سادهشده از Chainmap <https://code.activestate.com/recipes/305268/>`_."
msgid ":class:`ChainMap` Examples and Recipes"
msgstr "نمونهها و دستورپختهای :class:`ChainMap`"
msgid "This section shows various approaches to working with chained maps."
msgstr "این بخش روشهای مختلفی را برای کار با نگاشتهای زنجیرهای نشان میدهد."
msgid "Example of simulating Python's internal lookup chain::"
msgstr "مثالی از شبیهسازی زنجیرهی جستوجوی داخلی پایتون::"
msgid ""
"import builtins\n"
"pylookup = ChainMap(locals(), globals(), vars(builtins))"
msgstr ""
"import builtins\n"
"pylookup = ChainMap(locals(), globals(), vars(builtins))"
msgid "Example of letting user specified command-line arguments take precedence over environment variables which in turn take precedence over default values::"
msgstr "مثالی از اینکه آرگومانهای خط فرمان تعیینشده توسط کاربر بر متغیرهای محیطی اولویت داشته باشند و این متغیرها نیز بر مقادیر پیشفرض اولویت داشته باشند::"
msgid ""
"import os, argparse\n"
"\n"
"defaults = {'color': 'red', 'user': 'guest'}\n"
"\n"
"parser = argparse.ArgumentParser()\n"
"parser.add_argument('-u', '--user')\n"
"parser.add_argument('-c', '--color')\n"
"namespace = parser.parse_args()\n"
"command_line_args = {k: v for k, v in vars(namespace).items() if v is not None}\n"
"\n"
"combined = ChainMap(command_line_args, os.environ, defaults)\n"
"print(combined['color'])\n"
"print(combined['user'])"
msgstr ""
"import os, argparse\n"
"\n"
"defaults = {'color': 'red', 'user': 'guest'}\n"
"\n"
"parser = argparse.ArgumentParser()\n"
"parser.add_argument('-u', '--user')\n"
"parser.add_argument('-c', '--color')\n"
"namespace = parser.parse_args()\n"
"command_line_args = {k: v for k, v in vars(namespace).items() if v is not None}\n"
"\n"
"combined = ChainMap(command_line_args, os.environ, defaults)\n"
"print(combined['color'])\n"
"print(combined['user'])"
msgid "Example patterns for using the :class:`ChainMap` class to simulate nested contexts::"
msgstr "الگوهای نمونه برای استفاده از کلاس :class:`ChainMap` جهت شبیهسازی زمینههای تودرتو::"
msgid ""
"c = ChainMap() # Create root context\n"
"d = c.new_child() # Create nested child context\n"
"e = c.new_child() # Child of c, independent from d\n"
"e.maps[0] # Current context dictionary -- like Python's locals()\n"
"e.maps[-1] # Root context -- like Python's globals()\n"
"e.parents # Enclosing context chain -- like Python's nonlocals\n"
"\n"
"d['x'] = 1 # Set value in current context\n"
"d['x'] # Get first key in the chain of contexts\n"
"del d['x'] # Delete from current context\n"
"list(d) # All nested values\n"
"k in d # Check all nested values\n"
"len(d) # Number of nested values\n"
"d.items() # All nested items\n"
"dict(d) # Flatten into a regular dictionary"
msgstr ""
"c = ChainMap() # Create root context\n"
"d = c.new_child() # Create nested child context\n"
"e = c.new_child() # Child of c, independent from d\n"
"e.maps[0] # Current context dictionary -- like Python's locals()\n"
"e.maps[-1] # Root context -- like Python's globals()\n"
"e.parents # Enclosing context chain -- like Python's nonlocals\n"
"\n"
"d['x'] = 1 # Set value in current context\n"
"d['x'] # Get first key in the chain of contexts\n"
"del d['x'] # Delete from current context\n"
"list(d) # All nested values\n"
"k in d # Check all nested values\n"
"len(d) # Number of nested values\n"
"d.items() # All nested items\n"
"dict(d) # Flatten into a regular dictionary"
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 "کلاس :class:`ChainMap` فقط بهروزرسانیها (نوشتنها و حذفها) را روی اولین نگاشت در زنجیره اعمال میکند، در حالی که جستوجوها کل زنجیره را جستجو میکنند. با این حال، اگر نوشتنها و حذفها در عمق بیشتری از زنجیره مورد نظر باشند، ساخت زیرکلاسی که کلیدهای یافتشده در عمق بیشتری از زنجیره را بهروزرسانی کند، آسان است::"
msgid ""
"class DeepChainMap(ChainMap):\n"
" 'Variant of ChainMap that allows direct updates to inner scopes'\n"
"\n"
" def __setitem__(self, key, value):\n"
" for mapping in self.maps:\n"
" if key in mapping:\n"
" mapping[key] = value\n"
" return\n"
" self.maps[0][key] = value\n"
"\n"
" def __delitem__(self, key):\n"
" for mapping in self.maps:\n"
" if key in mapping:\n"
" del mapping[key]\n"
" return\n"
" raise KeyError(key)\n"
"\n"
">>> d = DeepChainMap({'zebra': 'black'}, {'elephant': 'blue'}, {'lion': 'yellow'})\n"
">>> d['lion'] = 'orange' # update an existing key two levels down\n"
">>> d['snake'] = 'red' # new keys get added to the topmost dict\n"
">>> del d['elephant'] # remove an existing key one level down\n"
">>> d # display result\n"
"DeepChainMap({'zebra': 'black', 'snake': 'red'}, {}, {'lion': 'orange'})"
msgstr ""
"class DeepChainMap(ChainMap):\n"
" 'Variant of ChainMap that allows direct updates to inner scopes'\n"
"\n"
" def __setitem__(self, key, value):\n"
" for mapping in self.maps:\n"
" if key in mapping:\n"
" mapping[key] = value\n"
" return\n"
" self.maps[0][key] = value\n"
"\n"
" def __delitem__(self, key):\n"
" for mapping in self.maps:\n"
" if key in mapping:\n"
" del mapping[key]\n"
" return\n"
" raise KeyError(key)\n"
"\n"
">>> d = DeepChainMap({'zebra': 'black'}, {'elephant': 'blue'}, {'lion': 'yellow'})\n"
">>> d['lion'] = 'orange' # update an existing key two levels down\n"
">>> d['snake'] = 'red' # new keys get added to the topmost dict\n"
">>> del d['elephant'] # remove an existing key one level down\n"
">>> d # display result\n"
"DeepChainMap({'zebra': 'black', 'snake': 'red'}, {}, {'lion': 'orange'})"
msgid ":class:`Counter` objects"
msgstr "اشیای :class:`Counter`"
msgid "A counter tool is provided to support convenient and rapid tallies. For example::"
msgstr "یک ابزار شمارنده برای پشتیبانی از شمارشهای آسان و سریع فراهم شده است. برای مثال::"
msgid ""
">>> # Tally occurrences of words in a list\n"
">>> cnt = Counter()\n"
">>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']:\n"
"... cnt[word] += 1\n"
"...\n"
">>> cnt\n"
"Counter({'blue': 3, 'red': 2, 'green': 1})\n"
"\n"
">>> # Find the ten most common words in Hamlet\n"
">>> import re\n"
">>> words = re.findall(r'\\w+', open('hamlet.txt').read().lower())\n"
">>> Counter(words).most_common(10)\n"
"[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),\n"
" ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]"
msgstr ""
">>> # Tally occurrences of words in a list\n"
">>> cnt = Counter()\n"
">>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']:\n"
"... cnt[word] += 1\n"
"...\n"
">>> cnt\n"
"Counter({'blue': 3, 'red': 2, 'green': 1})\n"
"\n"
">>> # Find the ten most common words in Hamlet\n"
">>> import re\n"
">>> words = re.findall(r'\\w+', open('hamlet.txt').read().lower())\n"
">>> Counter(words).most_common(10)\n"
"[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),\n"
" ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]"
msgid "A :class:`Counter` is a :class:`dict` subclass for counting :term:`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 "یک :class:`Counter` زیرکلاسی از :class:`dict` برای شمارش اشیای :term:`hashable` است. این مجموعهای است که در آن عناصر بهعنوان کلیدهای دیکشنری ذخیره میشوند و تعداد آنها بهعنوان مقادیر دیکشنری ذخیره میشود. تعدادها میتوانند هر مقدار عدد صحیحی باشند، از جمله صفر یا تعدادهای منفی. کلاس :class:`Counter` مشابه کیسهها (bags) یا چندمجموعهها (multisets) در زبانهای دیگر است."
msgid "Elements are counted from an *iterable* or initialized from another *mapping* (or counter):"
msgstr "عناصر از یک *پیمایشپذیر* شمارش میشوند یا از یک *نگاشت* (یا شمارنده) دیگر مقداردهی اولیه میشوند:"
msgid "Counter objects have a dictionary interface except that they return a zero count for missing items instead of raising a :exc:`KeyError`:"
msgstr "اشیای Counter یک رابط دیکشنری دارند، با این تفاوت که برای آیتمهای ناموجود، بهجای پرتاب :exc:`KeyError`، شمارش صفر برمیگردانند:"
msgid "Setting a count to zero does not remove an element from a counter. Use ``del`` to remove it entirely:"
msgstr "تنظیم یک شمارش روی صفر، یک عنصر را از شمارنده حذف نمیکند. برای حذف کامل آن از ``del`` استفاده کنید:"
msgid "As a :class:`dict` subclass, :class:`Counter` inherited the capability to remember insertion order. Math operations on *Counter* objects also preserve order. Results are ordered according to when an element is first encountered in the left operand and then by the order encountered in the right operand."
msgstr "بهعنوان یک زیرکلاس از :class:`dict`، :class:`Counter` قابلیت بهخاطر سپردن ترتیب درج را به ارث برده است. عملیاتهای ریاضی روی اشیای *Counter* نیز ترتیب را حفظ میکنند. نتایج بر اساس نخستین زمان مواجهه با هر عنصر در عملوند چپ و سپس بر اساس ترتیب مواجهه در عملوند راست مرتب میشوند."
msgid "Counter objects support additional methods beyond those available for all dictionaries:"
msgstr "اشیای Counter علاوه بر متدهای در دسترس برای همه دیکشنریها، از متدهای اضافی نیز پشتیبانی میکنند:"
msgid "Return an iterator over elements repeating each as many times as its count. Elements are returned in the order first encountered. If an element's count is less than one, :meth:`elements` will ignore it."
msgstr "یک پیمایشگر بر روی عناصر برمیگرداند که هر عنصر را به تعداد آن تکرار میکند. عناصر به ترتیبی که برای اولین بار مشاهده شدهاند برگردانده میشوند. اگر تعداد یک عنصر کمتر از ۱ باشد، :meth:`elements` آن را نادیده میگیرد."
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 in the order first encountered:"
msgstr "فهرستی از رایجترین *n* عنصر و تعداد آنها را از رایجترین به کمترین برمیگرداند. اگر *n* حذف شود یا ``None`` باشد، :meth:`most_common` *تمام* عناصر موجود در شمارنده را برمیگرداند. عناصری که تعداد برابر دارند، به ترتیبی که برای اولین بار مشاهده شدهاند مرتب میشوند:"
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 "عناصر از یک *پیمایشپذیر* یا از یک *نگاشت* دیگر (یا شمارنده) کم میشوند. مانند :meth:`dict.update` است، اما بهجای جایگزینی شمارشها، آنها را کم میکند. هم ورودیها و هم خروجیها میتوانند صفر یا منفی باشند."
msgid "Compute the sum of the counts."
msgstr "مجموع شمارشها را محاسبه کنید."
msgid "The usual dictionary methods are available for :class:`Counter` objects except for two which work differently for counters."
msgstr "متدهای معمول دیکشنری برای اشیای :class:`Counter` در دسترس هستند، بهجز دو مورد که برای شمارندهها متفاوت عمل میکنند."
msgid "This class method is not implemented for :class:`Counter` objects."
msgstr "این متد کلاس برای اشیای :class:`Counter` پیادهسازی نشده است."
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 "المانها از یک *پیمایشپذیر* شمرده میشوند یا از یک *نگاشت* (یا شمارنده) دیگر افزوده میشوند. مانند :meth:`dict.update` است، اما بهجای جایگزین کردن شمارشها، آنها را میافزاید. همچنین، انتظار میرود *پیمایشپذیر* دنبالهای از المانها باشد، نه دنبالهای از جفتهای ``(key, value)``."
msgid "Counters support rich comparison operators for equality, subset, and superset relationships: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``. All of those tests treat missing elements as having zero counts so that ``Counter(a=1) == Counter(a=1, b=0)`` returns true."
msgstr "شمارندهها از عملگرهای مقایسهای غنی برای روابط برابری، زیرمجموعه و ابرمجموعه پشتیبانی میکنند: ``==``، ``!=``، ``<``، ``<=``، ``>``، ``>=``. همهی این مقایسهها عناصر ناموجود را دارای تعداد صفر در نظر میگیرند، بهطوری که ``Counter(a=1) == Counter(a=1, b=0)`` مقدار درست برمیگرداند."
msgid "Rich comparison operations were added."
msgstr "عملیاتهای مقایسه غنی افزوده شدند."
msgid "In equality tests, missing elements are treated as having zero counts. Formerly, ``Counter(a=3)`` and ``Counter(a=3, b=0)`` were considered distinct."
msgstr "در آزمونهای برابری، عناصر غایب بهعنوان دارای تعداد صفر در نظر گرفته میشوند. پیش از این، ``Counter(a=3)`` و ``Counter(a=3, b=0)`` متمایز در نظر گرفته میشدند."
msgid "Common patterns for working with :class:`Counter` objects::"
msgstr "الگوهای رایج برای کار با اشیای :class:`Counter`::"
msgid ""
"c.total() # total of all counts\n"
"c.clear() # reset all counts\n"
"list(c) # list unique elements\n"
"set(c) # convert to a set\n"
"dict(c) # convert to a regular dictionary\n"
"c.items() # access the (elem, cnt) pairs\n"
"Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs\n"
"c.most_common()[:-n-1:-1] # n least common elements\n"
"+c # remove zero and negative counts"
msgstr ""
"c.total() # total of all counts\n"
"c.clear() # reset all counts\n"
"list(c) # list unique elements\n"
"set(c) # convert to a set\n"
"dict(c) # convert to a regular dictionary\n"
"c.items() # access the (elem, cnt) pairs\n"
"Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs\n"
"c.most_common()[:-n-1:-1] # n least common elements\n"
"+c # remove zero and negative counts"
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. Equality and inclusion compare corresponding counts. Each operation can accept inputs with signed counts, but the output will exclude results with counts of zero or less."
msgstr "چند عملیات ریاضی برای ترکیب اشیای :class:`Counter` و تولید چندمجموعهها (شمارندههایی که شمارشهای بزرگتر از صفر دارند) ارائه شده است. جمع و تفریق، شمارندهها را با افزودن یا کم کردن شمارشهای عناصر متناظر ترکیب میکنند. اشتراک و اجتماع، کمینه و بیشینهی شمارشهای متناظر را برمیگردانند. برابری و شمول، شمارشهای متناظر را مقایسه میکنند. هر عملیات میتواند ورودیهایی با شمارشهای علامتدار بپذیرد، اما خروجی، نتایجی را که شمارش آنها صفر یا کمتر است شامل نمیشود."
msgid ""
">>> c = Counter(a=3, b=1)\n"
">>> d = Counter(a=1, b=2)\n"
">>> c + d # add two counters together: c[x] + d[x]\n"
"Counter({'a': 4, 'b': 3})\n"
">>> c - d # subtract (keeping only positive counts)\n"
"Counter({'a': 2})\n"
">>> c & d # intersection: min(c[x], d[x])\n"
"Counter({'a': 1, 'b': 1})\n"
">>> c | d # union: max(c[x], d[x])\n"
"Counter({'a': 3, 'b': 2})\n"
">>> c == d # equality: c[x] == d[x]\n"
"False\n"
">>> c <= d # inclusion: c[x] <= d[x]\n"
"False"
msgstr ""
">>> c = Counter(a=3, b=1)\n"
">>> d = Counter(a=1, b=2)\n"
">>> c + d # add two counters together: c[x] + d[x]\n"
"Counter({'a': 4, 'b': 3})\n"
">>> c - d # subtract (keeping only positive counts)\n"
"Counter({'a': 2})\n"
">>> c & d # intersection: min(c[x], d[x])\n"
"Counter({'a': 1, 'b': 1})\n"
">>> c | d # union: max(c[x], d[x])\n"
"Counter({'a': 3, 'b': 2})\n"
">>> c == d # equality: c[x] == d[x]\n"
"False\n"
">>> c <= d # inclusion: c[x] <= d[x]\n"
"False"
msgid "Unary addition and subtraction are shortcuts for adding an empty counter or subtracting from an empty counter."
msgstr "جمع و تفریق یکعملوندی، میانبرهایی برای افزودن یک شمارنده خالی یا کم کردن از یک شمارنده خالی هستند."
msgid "Added support for unary plus, unary minus, and in-place multiset operations."
msgstr "پشتیبانی از عملگرهای یکعملوندی مثبت و منفی و عملیاتهای چندمجموعهای درجا افزوده شد."
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 "شمارندهها عمدتاً برای کار با اعداد صحیح مثبت به منظور نمایش شمارشهای جاری طراحی شدهاند؛ با این حال، دقت شده است که بهطور غیرضروری از موارد استفادهای که نیازمند انواع دیگر یا مقادیر منفی هستند جلوگیری نشود. برای کمک به این موارد استفاده، این بخش حداقل دامنه و محدودیتهای نوع را مستند میکند."
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 "خود کلاس :class:`Counter` زیرکلاسی از دیکشنری است و هیچ محدودیتی روی کلیدها و مقادیر آن ندارد. مقادیر در نظر گرفته شدهاند که اعدادی برای نمایش شمارشها باشند، اما شما *میتوانید* هر چیزی را در فیلد مقدار ذخیره کنید."
msgid "The :meth:`~Counter.most_common` method requires only that the values be orderable."
msgstr "متد :meth:`~Counter.most_common` تنها نیاز دارد که مقادیر قابل مرتبسازی باشند."
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 "برای عملیاتهای درجا مانند ``c[key] += 1``، نوع مقدار فقط باید از جمع و تفریق پشتیبانی کند. بنابراین کسرها، اعداد اعشاری و اعداد صحیح قابل استفاده هستند و مقادیر منفی نیز پشتیبانی میشوند. همین موضوع برای :meth:`~Counter.update` و :meth:`~Counter.subtract` نیز صادق است، که مقادیر منفی و صفر را برای هر دو ورودی و خروجی میپذیرند."
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 "متدهای چندمجموعه فقط برای موارد استفاده با مقادیر مثبت طراحی شدهاند. ورودیها ممکن است منفی یا صفر باشند، اما فقط خروجیهایی با مقادیر مثبت ایجاد میشوند. هیچ محدودیت نوعی وجود ندارد، اما نوع مقدار باید از جمع، تفریق و مقایسه پشتیبانی کند."
msgid "The :meth:`~Counter.elements` method requires integer counts. It ignores zero and negative counts."
msgstr "متد :meth:`~Counter.elements` به شمارشهای عدد صحیح نیاز دارد. این متد شمارشهای صفر و منفی را نادیده میگیرد."
msgid "`Bag class <https://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html>`_ in Smalltalk."
msgstr "`کلاس Bag <https://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html>`_ در Smalltalk."
msgid "Wikipedia entry for `Multisets <https://en.wikipedia.org/wiki/Multiset>`_."
msgstr "مدخل ویکیپدیا برای `چندمجموعهها <https://fa.wikipedia.org/wiki/چندمجموعه>`_."
msgid "`C++ multisets <http://www.java2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm>`_ tutorial with examples."
msgstr "`آموزش چندمجموعههای C++ <http://www.java2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm>`_ همراه با مثالها."
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 "برای عملیات ریاضی بر روی چندمجموعهها و موارد استفادهی آنها، *Knuth, Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise 19* را ببینید."
msgid "To enumerate all distinct multisets of a given size over a given set of elements, see :func:`itertools.combinations_with_replacement`::"
msgstr "برای برشمردن تمام چندمجموعههای متمایز با اندازهی مشخص بر روی یک مجموعهی مشخص از عناصر، :func:`itertools.combinations_with_replacement` را ببینید::"
msgid "map(Counter, combinations_with_replacement('ABC', 2)) # --> AA AB AC BB BC CC"
msgstr "map(Counter, combinations_with_replacement('ABC', 2)) # --> AA AB AC BB BC CC"
msgid ":class:`deque` objects"
msgstr "اشیای :class:`deque`"
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 "یک شیء deque جدید بازمیگرداند که از چپ به راست (با استفاده از :meth:`append`) با دادههای *iterable* مقداردهی اولیه شده است. اگر *iterable* مشخص نشده باشد، deque جدید خالی است."
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 "صفهای دوطرفه (deque) تعمیمی از پشتهها و صفها هستند (این نام بهصورت «deck» تلفظ میشود و کوتاهشدهی «double-ended queue» است). صفهای دوطرفه از افزودن و برداشتن ایمن برای نخها و کارآمد از نظر حافظه از هر طرف صف دوطرفه، با کارایی تقریباً یکسان *O*\\ (1) در هر جهت پشتیبانی میکنند."
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 "اگرچه اشیای :class:`list` از عملیات مشابهی پشتیبانی میکنند، اما برای عملیات سریع با طول ثابت بهینهسازی شدهاند و برای عملیات ``pop(0)`` و ``insert(0, v)`` که هم اندازه و هم موقعیت نمایش دادههای زیرین را تغییر میدهند، مستلزم هزینههای جابهجایی حافظه با مرتبهی *O*\\ (*n*) هستند."
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 "اگر *maxlen* مشخص نشده باشد یا ``None`` باشد، صفهای دوطرفه (deque) میتوانند تا طول دلخواهی رشد کنند. در غیر این صورت، صف دوطرفه به حداکثر طول مشخصشده محدود میشود. هنگامی که یک صف دوطرفه با طول محدود پر شد، با افزودن آیتمهای جدید، تعداد متناظری از آیتمها از سمت مخالف دور ریخته میشوند. صفهای دوطرفه با طول محدود، عملکردی مشابه فیلتر ``tail`` در Unix ارائه میدهند. آنها همچنین برای پیگیری تراکنشها و سایر مخازن دادهای که تنها جدیدترین فعالیت مورد توجه است، مفید هستند."
msgid "Deques are :ref:`generic <generics>` over the type of their contents."
msgstr "صفهای دوطرفه (deque) نسبت به نوع محتوای خود :ref:`عام <generics>` هستند."
msgid "Deque objects support the following methods:"
msgstr "اشیای Deque از متدهای زیر پشتیبانی میکنند:"
msgid "Add *item* to the right side of the deque."
msgstr "*item* را به سمت راست deque میافزاید."
msgid "Add *item* to the left side of the deque."
msgstr "*item* را به سمت چپ deque اضافه کنید."
msgid "Remove all elements from the deque leaving it with length 0."
msgstr "همهی عناصر را از صف دوطرفه (deque) حذف میکند و طول آن را به ۰ میرساند."
msgid "Create a shallow copy of the deque."
msgstr "یک کپی سطحی از deque ایجاد میکند."
msgid "Count the number of deque elements equal to *value*."
msgstr "تعداد عناصر deque برابر با *value* را میشمارد."
msgid "Extend the right side of the deque by appending elements from the iterable argument."
msgstr "سمت راست deque را با افزودن المانها از آرگومان پیمایشپذیر گسترش دهید."
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 "سمت چپ صف دوطرفه (deque) را با الحاق عناصری از *iterable* گسترش دهید. توجه داشته باشید که دنبالهی الحاقهای سمت چپ، باعث معکوس شدن ترتیب عناصر در آرگومان پیمایشپذیر میشود."
msgid "Return the position of *value* in the deque (at or after index *start* and before index *stop*). Returns the first match or raises :exc:`ValueError` if not found."
msgstr "موقعیت *value* را در صف دوطرفه (deque) برمیگرداند (در اندیس *start* یا پس از آن و پیش از اندیس *stop*). نخستین تطابق را برمیگرداند یا در صورت پیدا نشدن، :exc:`ValueError` را پرتاب میکند."
msgid "Insert *value* into the deque at position *index*."
msgstr "*value* را در موقعیت *index* در صف دوطرفه (deque) درج کنید."
msgid "If the insertion would cause a bounded deque to grow beyond *maxlen*, an :exc:`IndexError` is raised."
msgstr "اگر درج موجب شود که یک deque کراندار بزرگتر از *maxlen* شود، یک :exc:`IndexError` پرتاب میشود."
msgid "Remove and return an element from the right side of the deque. If no elements are present, raises an :exc:`IndexError`."
msgstr "یک المان را از سمت راست deque حذف کرده و برمیگرداند. اگر هیچ المانی وجود نداشته باشد، یک :exc:`IndexError` پرتاب میشود."
msgid "Remove and return an element from the left side of the deque. If no elements are present, raises an :exc:`IndexError`."
msgstr "یک عنصر را از سمت چپ deque حذف میکند و آن را برمیگرداند. اگر هیچ عنصری وجود نداشته باشد، یک :exc:`IndexError` پرتاب میشود."
msgid "Remove the first occurrence of *value*. If not found, raises a :exc:`ValueError`."
msgstr "اولین رخداد *value* را حذف میکند. اگر پیدا نشد، یک :exc:`ValueError` پرتاب میکند."
msgid "Reverse the elements of the deque in-place and then return ``None``."
msgstr "عناصر deque را بهصورت درجا معکوس میکند و سپس ``None`` را برمیگرداند."
msgid "Rotate the deque *n* steps to the right. If *n* is negative, rotate to the left."
msgstr "deque را *n* گام به راست بچرخانید. اگر *n* منفی باشد، به چپ بچرخانید."
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 "هنگامی که deque خالی نیست، چرخاندن یک گام به راست معادل ``d.appendleft(d.pop())`` است، و چرخاندن یک گام به چپ معادل ``d.append(d.popleft())`` است."
msgid "Deque objects also provide one read-only attribute:"
msgstr "اشیای Deque همچنین یک ویژگی فقطخواندنی ارائه میدهند:"
msgid "Maximum size of a deque or ``None`` if unbounded."
msgstr "حداکثر اندازهی یک deque یا ``None`` در صورت نامحدود بودن."
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[0]`` to access the first element. Indexed access is *O*\\ (1) at both ends but slows to *O*\\ (*n*) in the middle. For fast random access, use lists instead."
msgstr "علاوه بر موارد بالا، صفهای دوطرفه (deques) از تکرار، پیکلکردن، ``len(d)``، ``reversed(d)``، ``copy.copy(d)``، ``copy.deepcopy(d)``، بررسی عضویت با عملگر :keyword:`in`، و ارجاعهای اندیسی مانند ``d[0]`` برای دسترسی به اولین عنصر پشتیبانی میکنند. دسترسی اندیسی در هر دو انتها *O*\\ (1) است، اما در میانه به *O*\\ (*n*) کند میشود. برای دسترسی تصادفی سریع، بهجای آن از فهرستها استفاده کنید."
msgid "Starting in version 3.5, deques support ``__add__()``, ``__mul__()``, and ``__imul__()``."
msgstr "از نسخه 3.5 به بعد، صفهای دوطرفه (deque) از ``__add__()``، ``__mul__()`` و ``__imul__()`` پشتیبانی میکنند."
msgid "Example:"
msgstr "مثال:"
msgid ""
">>> from collections import deque\n"
">>> d = deque('ghi') # make a new deque with three items\n"
">>> for elem in d: # iterate over the deque's elements\n"
"... print(elem.upper())\n"
"G\n"
"H\n"
"I\n"
"\n"
">>> d.append('j') # add a new entry to the right side\n"
">>> d.appendleft('f') # add a new entry to the left side\n"
">>> d # show the representation of the deque\n"
"deque(['f', 'g', 'h', 'i', 'j'])\n"
"\n"
">>> d.pop() # return and remove the rightmost item\n"
"'j'\n"
">>> d.popleft() # return and remove the leftmost item\n"
"'f'\n"
">>> list(d) # list the contents of the deque\n"
"['g', 'h', 'i']\n"
">>> d[0] # peek at leftmost item\n"
"'g'\n"
">>> d[-1] # peek at rightmost item\n"
"'i'\n"
"\n"
">>> list(reversed(d)) # list the contents of a deque in reverse\n"
"['i', 'h', 'g']\n"
">>> 'h' in d # search the deque\n"
"True\n"
">>> d.extend('jkl') # add multiple elements at once\n"
">>> d\n"
"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n"
">>> d.rotate(1) # right rotation\n"
">>> d\n"
"deque(['l', 'g', 'h', 'i', 'j', 'k'])\n"
">>> d.rotate(-1) # left rotation\n"
">>> d\n"
"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n"
"\n"
">>> deque(reversed(d)) # make a new deque in reverse order\n"
"deque(['l', 'k', 'j', 'i', 'h', 'g'])\n"
">>> d.clear() # empty the deque\n"
">>> d.pop() # cannot pop from an empty deque\n"
"Traceback (most recent call last):\n"
" File \"<pyshell#6>\", line 1, in -toplevel-\n"
" d.pop()\n"
"IndexError: pop from an empty deque\n"
"\n"
">>> d.extendleft('abc') # extendleft() reverses the input order\n"
">>> d\n"
"deque(['c', 'b', 'a'])"
msgstr ""
">>> from collections import deque\n"
">>> d = deque('ghi') # make a new deque with three items\n"
">>> for elem in d: # iterate over the deque's elements\n"
"... print(elem.upper())\n"
"G\n"
"H\n"
"I\n"
"\n"
">>> d.append('j') # add a new entry to the right side\n"
">>> d.appendleft('f') # add a new entry to the left side\n"
">>> d # show the representation of the deque\n"
"deque(['f', 'g', 'h', 'i', 'j'])\n"
"\n"
">>> d.pop() # return and remove the rightmost item\n"
"'j'\n"
">>> d.popleft() # return and remove the leftmost item\n"
"'f'\n"
">>> list(d) # list the contents of the deque\n"
"['g', 'h', 'i']\n"
">>> d[0] # peek at leftmost item\n"
"'g'\n"
">>> d[-1] # peek at rightmost item\n"
"'i'\n"
"\n"
">>> list(reversed(d)) # list the contents of a deque in reverse\n"
"['i', 'h', 'g']\n"
">>> 'h' in d # search the deque\n"
"True\n"
">>> d.extend('jkl') # add multiple elements at once\n"
">>> d\n"
"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n"
">>> d.rotate(1) # right rotation\n"
">>> d\n"
"deque(['l', 'g', 'h', 'i', 'j', 'k'])\n"
">>> d.rotate(-1) # left rotation\n"
">>> d\n"
"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n"
"\n"
">>> deque(reversed(d)) # make a new deque in reverse order\n"
"deque(['l', 'k', 'j', 'i', 'h', 'g'])\n"
">>> d.clear() # empty the deque\n"
">>> d.pop() # cannot pop from an empty deque\n"
"Traceback (most recent call last):\n"
" File \"<pyshell#6>\", line 1, in -toplevel-\n"
" d.pop()\n"
"IndexError: pop from an empty deque\n"
"\n"
">>> d.extendleft('abc') # extendleft() reverses the input order\n"
">>> d\n"
"deque(['c', 'b', 'a'])"
msgid ":class:`deque` Recipes"
msgstr "دستور پختهای :class:`deque`"
msgid "This section shows various approaches to working with deques."
msgstr "این بخش روشهای مختلفی را برای کار با صفهای دوطرفه (deque) نشان میدهد."
msgid "Bounded length deques provide functionality similar to the ``tail`` filter in Unix::"
msgstr "صفهای دوطرفه (deque) با طول محدود، عملکردی مشابه فیلتر ``tail`` در یونیکس فراهم میکنند::"
msgid ""
"def tail(filename, n=10):\n"
" 'Return the last n lines of a file'\n"
" with open(filename) as f:\n"
" return deque(f, n)"
msgstr ""
"def tail(filename, n=10):\n"
" 'Return the last n lines of a file'\n"
" with open(filename) as f:\n"
" return deque(f, n)"
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 "رویکرد دیگر برای استفاده از صفهای دوطرفه (deque)، نگهداری دنبالهای از المانهای بهتازگی اضافهشده با افزودن به راست و برداشتن از چپ است::"
msgid ""
"def moving_average(iterable, n=3):\n"
" # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0\n"
" # https://en.wikipedia.org/wiki/Moving_average\n"
" it = iter(iterable)\n"
" d = deque(itertools.islice(it, n-1))\n"
" d.appendleft(0)\n"
" s = sum(d)\n"
" for elem in it:\n"
" s += elem - d.popleft()\n"
" d.append(elem)\n"
" yield s / n"
msgstr ""
"def moving_average(iterable, n=3):\n"
" # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0\n"
" # https://en.wikipedia.org/wiki/Moving_average\n"
" it = iter(iterable)\n"
" d = deque(itertools.islice(it, n-1))\n"
" d.appendleft(0)\n"
" s = sum(d)\n"
" for elem in it:\n"
" s += elem - d.popleft()\n"
" d.append(elem)\n"
" yield s / n"
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 :term:`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 "یک `زمانبندی چرخشی <https://en.wikipedia.org/wiki/Round-robin_scheduling>`_ میتواند با پیمایشگرهای ورودی که در یک :class:`deque` ذخیره شدهاند پیادهسازی شود. مقادیر از پیمایشگر فعال در موقعیت صفر تولید میشوند. اگر آن پیمایشگر :term:`اتمامیافته <exhausted>` باشد، میتواند با :meth:`~deque.popleft` حذف شود؛ در غیر این صورت، میتواند با متد :meth:`~deque.rotate` به انتهای چرخه بازگردانده شود::"
msgid ""
"def roundrobin(*iterables):\n"
" \"roundrobin('ABC', 'D', 'EF') --> A D E B F C\"\n"
" iterators = deque(map(iter, iterables))\n"
" while iterators:\n"
" try:\n"
" while True:\n"
" yield next(iterators[0])\n"
" iterators.rotate(-1)\n"
" except StopIteration:\n"
" # Remove an exhausted iterator.\n"
" iterators.popleft()"
msgstr ""
"def roundrobin(*iterables):\n"
" \"roundrobin('ABC', 'D', 'EF') --> A D E B F C\"\n"
" iterators = deque(map(iter, iterables))\n"
" while iterators:\n"
" try:\n"
" while True:\n"
" yield next(iterators[0])\n"
" iterators.rotate(-1)\n"
" except StopIteration:\n"
" # Remove an exhausted iterator.\n"
" iterators.popleft()"
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 "متد :meth:`~deque.rotate` راهی برای پیادهسازی اسلایس و حذف :class:`deque` فراهم میکند. برای مثال، یک پیادهسازی پایتون خالص از ``del d[n]`` برای قرار دادن عناصر در موقعیت مناسب جهت خارج کردن، به متد ``rotate()`` متکی است::"
msgid ""
"def delete_nth(d, n):\n"
" d.rotate(-n)\n"
" d.popleft()\n"
" d.rotate(n)"
msgstr ""
"def delete_nth(d, n):\n"
" d.rotate(-n)\n"
" d.popleft()\n"
" d.rotate(n)"
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 "برای پیادهسازی اسلایس :class:`deque`، از رویکرد مشابهی با اعمال :meth:`~deque.rotate` استفاده کنید تا یک عنصر هدف به سمت چپ deque برسد. آیتمهای قدیمی را با :meth:`~deque.popleft` حذف کنید، آیتمهای جدید را با :meth:`~deque.extend` اضافه کنید و سپس چرخش را معکوس کنید. با تغییرات جزئی در این رویکرد، پیادهسازی دستکاریهای پشته به سبک Forth مانند ``dup``، ``drop``، ``swap``، ``over``، ``pick``، ``rot`` و ``roll`` آسان است."
msgid ":class:`defaultdict` objects"
msgstr "اشیای :class:`defaultdict`"
msgid "Return 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 "یک شیء دیکشنریمانند جدید برمیگرداند. :class:`defaultdict` زیرکلاسی از کلاس توکار :class:`dict` است. این کلاس یک متد را بازتعریف میکند و یک متغیر نمونه قابلنوشتن اضافه میکند. سایر قابلیتها مانند کلاس :class:`dict` هستند و در اینجا مستند نشدهاند."
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 "نخستین آرگومان مقدار اولیهی ویژگی :attr:`default_factory` را فراهم میکند؛ مقدار پیشفرض آن ``None`` است. با تمام آرگومانهای باقیمانده همانگونه رفتار میشود که گویی به سازندهی :class:`dict` ارسال شده باشند، از جمله آرگومانهای کلیدواژهای."
msgid ":class:`!defaultdict`\\s are :ref:`generic <generics>` over two types, signifying (respectively) the types of the dictionary's keys and values."
msgstr ":class:`!defaultdict`\\ها نسبت به دو نوع :ref:`عام <generics>` هستند که (بهترتیب) بیانگر انواع کلیدها و مقادیر دیکشنری هستند."
msgid ":class:`defaultdict` objects support the following method in addition to the standard :class:`dict` operations:"
msgstr "اشیای :class:`defaultdict` علاوه بر عملیات استاندارد :class:`dict`، از متد زیر نیز پشتیبانی میکنند:"
msgid "If the :attr:`default_factory` attribute is ``None``, this raises a :exc:`KeyError` exception with the *key* as argument."
msgstr "اگر ویژگی :attr:`default_factory` برابر ``None`` باشد، این عمل یک استثنای :exc:`KeyError` را با *key* بهعنوان آرگومان پرتاب میکند."
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 "اگر :attr:`default_factory` برابر ``None`` نباشد، بدون آرگومان فراخوانی میشود تا مقدار پیشفرضی برای *کلید* دادهشده فراهم کند؛ این مقدار در دیکشنری برای *کلید* درج میشود و برگردانده میشود."
msgid "If calling :attr:`default_factory` raises an exception this exception is propagated unchanged."
msgstr "اگر فراخوانی :attr:`default_factory` باعث پرتاب استثنایی شود، این استثنا بدون تغییر انتشار مییابد."
msgid "This method is called by the :meth:`~object.__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:`~object.__getitem__`."
msgstr "این متد توسط متد :meth:`~object.__getitem__` از کلاس :class:`dict` زمانی فراخوانی میشود که کلید درخواستشده یافت نشود؛ هر آنچه برگرداند یا پرتاب کند، سپس توسط :meth:`~object.__getitem__` برگردانده یا پرتاب میشود."
msgid "Note that :meth:`__missing__` is *not* called for any operations besides :meth:`~object.__getitem__`. This means that :meth:`~dict.get` will, like normal dictionaries, return ``None`` as a default rather than using :attr:`default_factory`."
msgstr "توجه داشته باشید که :meth:`__missing__` برای هیچ عملیاتی به جز :meth:`~object.__getitem__` فراخوانی *نمیشود*. این بدان معناست که :meth:`~dict.get` مانند دیکشنریهای معمولی، به جای استفاده از :attr:`default_factory`، ``None`` را بهعنوان مقدار پیشفرض برمیگرداند."
msgid ":class:`defaultdict` objects support the following instance variable:"
msgstr "اشیای :class:`defaultdict` از متغیر نمونهی زیر پشتیبانی میکنند:"
msgid "This attribute is used by the :meth:`~defaultdict.__missing__` method; it is initialized from the first argument to the constructor, if present, or to ``None``, if absent."
msgstr "این ویژگی توسط متد :meth:`~defaultdict.__missing__` استفاده میشود؛ در صورت وجود اولین آرگومان سازنده، از آن مقداردهی اولیه میشود و در غیر این صورت به ``None`` مقداردهی اولیه میشود."
msgid "Added merge (``|``) and update (``|=``) operators, specified in :pep:`584`."
msgstr "عملگرهای ادغام (``|``) و بهروزرسانی (``|=``)، مشخصشده در :pep:`584`، افزوده شدند."
msgid ":class:`defaultdict` Examples"
msgstr "مثالهای :class:`defaultdict`"
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 "با استفاده از :class:`list` بهعنوان :attr:`~defaultdict.default_factory`، بهآسانی میتوان دنبالهای از جفتهای کلید-مقدار را در یک دیکشنری از فهرستها گروهبندی کرد:"
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 "هنگامی که هر کلید برای نخستین بار مشاهده میشود، از قبل در نگاشت وجود ندارد؛ بنابراین یک آیتم بهطور خودکار با استفاده از تابع :attr:`~defaultdict.default_factory` ایجاد میشود که یک :class:`list` خالی برمیگرداند. سپس عملیات :meth:`list.append` مقدار را به فهرست جدید اضافه میکند. هنگامی که کلیدها دوباره مشاهده میشوند، جستوجو بهطور عادی انجام میشود (فهرست مربوط به آن کلید را برمیگرداند) و عملیات :meth:`list.append` مقدار دیگری را به فهرست اضافه میکند. این روش سادهتر و سریعتر از روش معادلی است که از :meth:`dict.setdefault` استفاده میکند:"
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 "با تنظیم :attr:`~defaultdict.default_factory` روی :class:`int`، :class:`defaultdict` برای شمارش مفید میشود (مانند bag یا multiset در زبانهای دیگر):"
msgid "When a letter is first encountered, it is missing from the mapping, so the :attr:`~defaultdict.default_factory` function calls :func:`int` to supply a default count of zero. The increment operation then builds up the count for each letter."
msgstr "هنگامی که برای نخستین بار با حرفی مواجه میشوید، آن حرف در نگاشت وجود ندارد، بنابراین تابع :attr:`~defaultdict.default_factory`، تابع :func:`int` را فراخوانی میکند تا یک شمارش پیشفرض برابر با صفر فراهم کند. سپس عملیات افزایش، شمارش هر حرف را بهتدریج افزایش میدهد."
msgid "The function :func:`int` which always returns zero is just a special case of constant functions. A faster and more flexible way to create constant functions is to use a lambda function which can supply any constant value (not just zero):"
msgstr "تابع :func:`int` که همیشه صفر را برمیگرداند، تنها حالت خاصی از توابع ثابت است. راهی سریعتر و انعطافپذیرتر برای ایجاد توابع ثابت، استفاده از یک تابع لامبدا است که میتواند هر مقدار ثابتی را ارائه کند (نه فقط صفر):"
msgid "Setting the :attr:`~defaultdict.default_factory` to :class:`set` makes the :class:`defaultdict` useful for building a dictionary of sets:"
msgstr "با تنظیم :attr:`~defaultdict.default_factory` روی :class:`set`، :class:`defaultdict` برای ساختن یک دیکشنری از مجموعهها مفید میشود:"
msgid ":func:`namedtuple` Factory Function for Tuples with Named Fields"
msgstr ":func:`namedtuple` تابع کارخانه برای تاپلهای دارای فیلدهای نامدار"
msgid "Named tuples assign meaning to each position in a tuple and allow for more readable, self-documenting code. They can be used wherever regular tuples are used, and they add the ability to access fields by name instead of position index."
msgstr "تاپلهای نامدار به هر جایگاه در یک تاپل معنا میبخشند و امکان کدی خواناتر و خودمستند را فراهم میکنند. این تاپلها میتوانند هر جا که تاپلهای معمولی استفاده میشوند، به کار روند و توانایی دسترسی به فیلدها از طریق نام بهجای اندیس جایگاه را اضافه کنند."
msgid "Returns a new tuple subclass named *typename*. The new subclass is used to create tuple-like objects that have fields accessible by attribute lookup as well as being indexable and iterable. Instances of the subclass also have a helpful docstring (with *typename* and *field_names*) and a helpful :meth:`~object.__repr__` method which lists the tuple contents in a ``name=value`` format."
msgstr "یک زیرکلاس جدید از تاپل به نام *typename* برمیگرداند. زیرکلاس جدید برای ایجاد اشیایی شبیه به تاپل به کار میرود که فیلدهایی قابل دسترسی از طریق جستوجوی ویژگی دارند و همچنین قابل اندیسگذاری و پیمایشپذیر هستند. نمونههای این زیرکلاس همچنین یک رشته مستند مفید (شامل *typename* و *field_names*) و یک متد مفید :meth:`~object.__repr__` دارند که محتویات تاپل را در قالب ``name=value`` فهرست میکند."
msgid "The *field_names* are a sequence of strings such as ``['x', 'y']``. Alternatively, *field_names* can be a single string with each fieldname separated by whitespace and/or commas, for example ``'x y'`` or ``'x, y'``."
msgstr "*field_names* دنبالهای از رشتهها مانند ``['x', 'y']`` است. بهعنوان جایگزین، *field_names* میتواند یک رشته واحد باشد که در آن هر نام فیلد با فضای خالی و/یا کاما جدا شده باشد، برای مثال ``'x y'`` یا ``'x, y'``."
msgid "Any valid Python identifier may be used for a fieldname except for names starting with an underscore. Valid identifiers consist of letters, digits, and underscores but do not start with a digit or underscore and cannot be a :mod:`keyword` such as *class*, *for*, *return*, *global*, *pass*, or *raise*."
msgstr "هر شناسه معتبر پایتون را میتوان برای نام فیلد به کار برد، بهجز نامهایی که با زیرخط شروع میشوند. شناسههای معتبر از حروف، ارقام و زیرخط تشکیل میشوند، اما با رقم یا زیرخط شروع نمیشوند و نمیتوانند یک :mod:`keyword` مانند *class*، *for*، *return*، *global*، *pass* یا *raise* باشند."
msgid "If *rename* is true, invalid fieldnames are automatically replaced with positional names. For example, ``['abc', 'def', 'ghi', 'abc']`` is converted to ``['abc', '_1', 'ghi', '_3']``, eliminating the keyword ``def`` and the duplicate fieldname ``abc``."
msgstr "اگر *rename* مقدار true داشته باشد، نامهای فیلد نامعتبر بهطور خودکار با نامهای جایگاهی جایگزین میشوند. برای مثال، ``['abc', 'def', 'ghi', 'abc']`` به ``['abc', '_1', 'ghi', '_3']`` تبدیل میشود و کلیدواژه ``def`` و نام فیلد تکراری ``abc`` حذف میشوند."
msgid "*defaults* can be ``None`` or an :term:`iterable` of default values. Since fields with a default value must come after any fields without a default, the *defaults* are applied to the rightmost parameters. For example, if the fieldnames are ``['x', 'y', 'z']`` and the defaults are ``(1, 2)``, then ``x`` will be a required argument, ``y`` will default to ``1``, and ``z`` will default to ``2``."
msgstr "*defaults* میتواند ``None`` یا یک :term:`پیمایشپذیر <iterable>` از مقادیر پیشفرض باشد. از آنجا که فیلدهای دارای مقدار پیشفرض باید بعد از فیلدهای بدون مقدار پیشفرض بیایند، *defaults* به راستترین پارامترها اعمال میشود. برای مثال، اگر نام فیلدها ``['x', 'y', 'z']`` و مقادیر پیشفرض ``(1, 2)`` باشند، ``x`` یک آرگومان ضروری خواهد بود، مقدار پیشفرض ``y`` برابر ``1`` خواهد بود، و مقدار پیشفرض ``z`` برابر ``2`` خواهد بود."
msgid "If *module* is defined, the :attr:`~type.__module__` attribute of the named tuple is set to that value."
msgstr "اگر *module* تعریف شده باشد، ویژگی :attr:`~type.__module__` تاپل نامدار (named tuple) برابر آن مقدار قرار میگیرد."
msgid "Named tuple instances do not have per-instance dictionaries, so they are lightweight and require no more memory than regular tuples."
msgstr "نمونههای تاپل نامدار، دیکشنریهای بهازای هر نمونه ندارند، بنابراین سبک هستند و به حافظه بیشتری نسبت به تاپلهای معمولی نیاز ندارند."
msgid "To support pickling, the named tuple class should be assigned to a variable that matches *typename*."
msgstr "برای پشتیبانی از پیکلکردن، کلاس تاپل نامدار (named tuple) باید به متغیری اختصاص داده شود که با *typename* مطابقت داشته باشد."
msgid "Added support for *rename*."
msgstr "پشتیبانی از *rename* افزوده شد."
msgid "The *verbose* and *rename* parameters became :ref:`keyword-only arguments <keyword-only_parameter>`."
msgstr "پارامترهای *verbose* و *rename* به :ref:`آرگومانهای فقط کلیدواژهای <keyword-only_parameter>` تبدیل شدند."
msgid "Added the *module* parameter."
msgstr "پارامتر *module* اضافه شد."
msgid "Removed the *verbose* parameter and the :attr:`!_source` attribute."
msgstr "پارامتر *verbose* و ویژگی :attr:`!_source` حذف شدند."
msgid "Added the *defaults* parameter and the :attr:`~somenamedtuple._field_defaults` attribute."
msgstr "پارامتر *defaults* و ویژگی :attr:`~somenamedtuple._field_defaults` اضافه شد."
msgid ""
">>> # Basic example\n"
">>> Point = namedtuple('Point', ['x', 'y'])\n"
">>> p = Point(11, y=22) # instantiate with positional or keyword arguments\n"
">>> p[0] + p[1] # indexable like the plain tuple (11, 22)\n"
"33\n"
">>> x, y = p # unpack like a regular tuple\n"
">>> x, y\n"
"(11, 22)\n"
">>> p.x + p.y # fields also accessible by name\n"
"33\n"
">>> p # readable __repr__ with a name=value style\n"
"Point(x=11, y=22)"
msgstr ""
">>> # Basic example\n"
">>> Point = namedtuple('Point', ['x', 'y'])\n"
">>> p = Point(11, y=22) # instantiate with positional or keyword arguments\n"
">>> p[0] + p[1] # indexable like the plain tuple (11, 22)\n"
"33\n"
">>> x, y = p # unpack like a regular tuple\n"
">>> x, y\n"
"(11, 22)\n"
">>> p.x + p.y # fields also accessible by name\n"
"33\n"
">>> p # readable __repr__ with a name=value style\n"
"Point(x=11, y=22)"
msgid "Named tuples are especially useful for assigning field names to result tuples returned by the :mod:`csv` or :mod:`sqlite3` modules::"
msgstr "تاپلهای نامدار بهویژه برای اختصاص نامهای فیلد به تاپلهای نتیجهای که از ماژولهای :mod:`csv` یا :mod:`sqlite3` بازگردانده میشوند، مفید هستند::"
msgid ""
"EmployeeRecord = namedtuple('EmployeeRecord', 'name, age, title, department, paygrade')\n"
"\n"
"import csv\n"
"for emp in map(EmployeeRecord._make, csv.reader(open(\"employees.csv\", \"rb\"))):\n"
" print(emp.name, emp.title)\n"
"\n"
"import sqlite3\n"
"conn = sqlite3.connect('/companydata')\n"
"cursor = conn.cursor()\n"
"cursor.execute('SELECT name, age, title, department, paygrade FROM employees')\n"
"for emp in map(EmployeeRecord._make, cursor.fetchall()):\n"
" print(emp.name, emp.title)"
msgstr ""
"EmployeeRecord = namedtuple('EmployeeRecord', 'name, age, title, department, paygrade')\n"
"\n"
"import csv\n"
"for emp in map(EmployeeRecord._make, csv.reader(open(\"employees.csv\", \"rb\"))):\n"
" print(emp.name, emp.title)\n"
"\n"
"import sqlite3\n"
"conn = sqlite3.connect('/companydata')\n"
"cursor = conn.cursor()\n"
"cursor.execute('SELECT name, age, title, department, paygrade FROM employees')\n"
"for emp in map(EmployeeRecord._make, cursor.fetchall()):\n"
" print(emp.name, emp.title)"
msgid "In addition to the methods inherited from tuples, named tuples support three additional methods and two attributes. To prevent conflicts with field names, the method and attribute names start with an underscore."
msgstr "علاوه بر متدهای به ارث بردهشده از تاپلها، تاپلهای نامدار از سه متد و دو ویژگی اضافی پشتیبانی میکنند. برای جلوگیری از تداخل با نام فیلدها، نام متدها و ویژگیها با یک زیرخط شروع میشوند."
msgid "Class method that makes a new instance from an existing sequence or iterable."
msgstr "متد کلاسی که یک نمونه جدید را از یک دنباله یا پیمایشپذیر موجود میسازد."
msgid ""
">>> t = [11, 22]\n"
">>> Point._make(t)\n"
"Point(x=11, y=22)"
msgstr ""
">>> t = [11, 22]\n"
">>> Point._make(t)\n"
"Point(x=11, y=22)"
msgid "Return a new :class:`dict` which maps field names to their corresponding values:"
msgstr "یک :class:`dict` جدید برمیگرداند که نام فیلدها را به مقادیر متناظر آنها نگاشت میکند:"
msgid ""
">>> p = Point(x=11, y=22)\n"
">>> p._asdict()\n"
"{'x': 11, 'y': 22}"
msgstr ""
">>> p = Point(x=11, y=22)\n"
">>> p._asdict()\n"
"{'x': 11, 'y': 22}"
msgid "Returns an :class:`OrderedDict` instead of a regular :class:`dict`."
msgstr "یک :class:`OrderedDict` بهجای یک :class:`dict` معمولی برمیگرداند."
msgid "Returns a regular :class:`dict` instead of an :class:`OrderedDict`. As of Python 3.7, regular dicts are guaranteed to be ordered. If the extra features of :class:`OrderedDict` are required, the suggested remediation is to cast the result to the desired type: ``OrderedDict(nt._asdict())``."
msgstr "یک :class:`dict` معمولی را بهجای یک :class:`OrderedDict` بازمیگرداند. از پایتون 3.7 به بعد، ترتیب دیکشنریهای معمولی تضمین شده است. اگر امکانات اضافی :class:`OrderedDict` مورد نیاز باشد، راهحل پیشنهادی، تبدیل نتیجه به نوع دلخواه است: ``OrderedDict(nt._asdict())``."
msgid "Return a new instance of the named tuple replacing specified fields with new values::"
msgstr "یک نمونه جدید از تاپل نامدار (named tuple) برمیگرداند که در آن فیلدهای مشخصشده با مقدارهای جدید جایگزین شدهاند::"
msgid ""
">>> p = Point(x=11, y=22)\n"
">>> p._replace(x=33)\n"
"Point(x=33, y=22)\n"
"\n"
">>> for partnum, record in inventory.items():\n"
"... inventory[partnum] = record._replace(price=newprices[partnum], timestamp=time.now())"
msgstr ""
">>> p = Point(x=11, y=22)\n"
">>> p._replace(x=33)\n"
"Point(x=33, y=22)\n"
"\n"
">>> for partnum, record in inventory.items():\n"
"... inventory[partnum] = record._replace(price=newprices[partnum], timestamp=time.now())"
msgid "Named tuples are also supported by generic function :func:`copy.replace`."
msgstr "تابع عام :func:`copy.replace` نیز از تاپلهای نامدار (named tuples) پشتیبانی میکند."
msgid "Raise :exc:`TypeError` instead of :exc:`ValueError` for invalid keyword arguments."
msgstr "برای آرگومانهای کلیدواژهای نامعتبر، بهجای :exc:`ValueError`، :exc:`TypeError` ایجاد میکند."
msgid "Tuple of strings listing the field names. Useful for introspection and for creating new named tuple types from existing named tuples."
msgstr "تاپلی از رشتهها که نام فیلدها را فهرست میکند. برای دروننگری و ایجاد انواع جدیدی از تاپلهای نامدار از تاپلهای نامدار موجود مفید است."
msgid ""
">>> p._fields # view the field names\n"
"('x', 'y')\n"
"\n"
">>> Color = namedtuple('Color', 'red green blue')\n"
">>> Pixel = namedtuple('Pixel', Point._fields + Color._fields)\n"
">>> Pixel(11, 22, 128, 255, 0)\n"