-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathcollections.abc.po
More file actions
554 lines (412 loc) · 38.7 KB
/
Copy pathcollections.abc.po
File metadata and controls
554 lines (412 loc) · 38.7 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
# 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-16 12:56+0000\n"
"PO-Revision-Date: 2026-09-14 10:24+0330\n"
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
"Language-Team: Persian (https://github.com/python/python-docs-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.abc` --- Abstract Base Classes for Containers"
msgstr ":mod:`!collections.abc` --- کلاسهای پایه انتزاعی برای ظروف"
msgid "Formerly, this module was part of the :mod:`collections` module."
msgstr "پیشتر، این ماژول بخشی از ماژول :mod:`collections` بود."
msgid "**Source code:** :source:`Lib/_collections_abc.py`"
msgstr "**کد منبع:** :source:`Lib/_collections_abc.py`"
msgid "This module provides :term:`abstract base classes <abstract base class>` that can be used to test whether a class provides a particular interface; for example, whether it is :term:`hashable` or whether it is a :term:`mapping`."
msgstr "این ماژول :term:`کلاسهای پایه انتزاعی <abstract base class>` را فراهم میکند که میتوان از آنها برای بررسی اینکه آیا یک کلاس رابط خاصی را ارائه میدهد استفاده کرد؛ برای مثال، اینکه آیا :term:`هشپذیر <hashable>` است یا یک :term:`نگاشت <mapping>` است."
msgid "An :func:`issubclass` or :func:`isinstance` test for an interface works in one of three ways."
msgstr "یک آزمون :func:`issubclass` یا :func:`isinstance` برای یک رابط به یکی از سه روش عمل میکند."
msgid "A newly written class can inherit directly from one of the abstract base classes. The class must supply the required abstract methods. The remaining mixin methods come from inheritance and can be overridden if desired. Other methods may be added as needed:"
msgstr "یک کلاس تازهنوشتهشده میتواند مستقیماً از یکی از کلاسهای پایه انتزاعی ارث ببرد. این کلاس باید متدهای انتزاعی مورد نیاز را فراهم کند. متدهای میکساین باقیمانده از طریق ارثبری به دست میآیند و در صورت تمایل میتوان آنها را بازنویسی کرد. در صورت نیاز، میتوان متدهای دیگری اضافه کرد:"
msgid ""
"class C(Sequence): # Direct inheritance\n"
" def __init__(self): ... # Extra method not required by the ABC\n"
" def __getitem__(self, index): ... # Required abstract method\n"
" def __len__(self): ... # Required abstract method\n"
" def count(self, value): ... # Optionally override a mixin method"
msgstr ""
"class C(Sequence): # Direct inheritance\n"
" def __init__(self): ... # Extra method not required by the ABC\n"
" def __getitem__(self, index): ... # Required abstract method\n"
" def __len__(self): ... # Required abstract method\n"
" def count(self, value): ... # Optionally override a mixin method"
msgid ""
">>> issubclass(C, Sequence)\n"
"True\n"
">>> isinstance(C(), Sequence)\n"
"True"
msgstr ""
">>> issubclass(C, Sequence)\n"
"True\n"
">>> isinstance(C(), Sequence)\n"
"True"
msgid "Existing classes and built-in classes can be registered as \"virtual subclasses\" of the ABCs. Those classes should define the full API including all of the abstract methods and all of the mixin methods. This lets users rely on :func:`issubclass` or :func:`isinstance` tests to determine whether the full interface is supported. The exception to this rule is for methods that are automatically inferred from the rest of the API:"
msgstr "کلاسهای موجود و کلاسهای توکار میتوانند بهعنوان «زیرکلاسهای مجازی» ABCها ثبت شوند. آن کلاسها باید API کامل را، شامل تمام متدهای انتزاعی و تمام متدهای میکساین، تعریف کنند. این امر به کاربران اجازه میدهد برای تعیین اینکه آیا رابط کامل پشتیبانی میشود، به آزمونهای :func:`issubclass` یا :func:`isinstance` اتکا کنند. استثنای این قاعده برای متدهایی است که بهطور خودکار از باقی API استنتاج میشوند:"
msgid ""
"class D: # No inheritance\n"
" def __init__(self): ... # Extra method not required by the ABC\n"
" def __getitem__(self, index): ... # Abstract method\n"
" def __len__(self): ... # Abstract method\n"
" def count(self, value): ... # Mixin method\n"
" def index(self, value): ... # Mixin method\n"
"\n"
"Sequence.register(D) # Register instead of inherit"
msgstr ""
"class D: # No inheritance\n"
" def __init__(self): ... # Extra method not required by the ABC\n"
" def __getitem__(self, index): ... # Abstract method\n"
" def __len__(self): ... # Abstract method\n"
" def count(self, value): ... # Mixin method\n"
" def index(self, value): ... # Mixin method\n"
"\n"
"Sequence.register(D) # Register instead of inherit"
msgid ""
">>> issubclass(D, Sequence)\n"
"True\n"
">>> isinstance(D(), Sequence)\n"
"True"
msgstr ""
">>> issubclass(D, Sequence)\n"
"True\n"
">>> isinstance(D(), Sequence)\n"
"True"
msgid "In this example, class :class:`!D` does not need to define ``__contains__``, ``__iter__``, and ``__reversed__`` because the :ref:`in-operator <comparisons>`, the :term:`iteration <iterable>` logic, and the :func:`reversed` function automatically fall back to using ``__getitem__`` and ``__len__``."
msgstr "در این مثال، کلاس :class:`!D` نیازی به تعریف ``__contains__``، ``__iter__`` و ``__reversed__`` ندارد، زیرا :ref:`عملگر in <comparisons>`، منطق :term:`پیمایش <iterable>` و تابع :func:`reversed` بهطور خودکار به استفاده از ``__getitem__`` و ``__len__`` بازمیگردند."
msgid "Some simple interfaces are directly recognizable by the presence of the required methods (unless those methods have been set to :const:`None`):"
msgstr "برخی رابطهای ساده مستقیماً از روی وجود متدهای مورد نیاز قابل تشخیص هستند (مگر آنکه آن متدها روی :const:`None` تنظیم شده باشند):"
msgid ""
"class E:\n"
" def __iter__(self): ...\n"
" def __next__(self): ..."
msgstr ""
"class E:\n"
" def __iter__(self): ...\n"
" def __next__(self): ..."
msgid ""
">>> issubclass(E, Iterable)\n"
"True\n"
">>> isinstance(E(), Iterable)\n"
"True"
msgstr ""
">>> issubclass(E, Iterable)\n"
"True\n"
">>> isinstance(E(), Iterable)\n"
"True"
msgid "Complex interfaces do not support this last technique because an interface is more than just the presence of method names. Interfaces specify semantics and relationships between methods that cannot be inferred solely from the presence of specific method names. For example, knowing that a class supplies ``__getitem__``, ``__len__``, and ``__iter__`` is insufficient for distinguishing a :class:`Sequence` from a :class:`Mapping`."
msgstr "رابطهای پیچیده از این روش آخر پشتیبانی نمیکنند، زیرا یک رابط چیزی فراتر از صرف وجود نام متدها است. رابطها معناشناسی و روابط میان متدها را مشخص میکنند، که نمیتوان آنها را صرفاً از وجود نام متدهای خاص استنتاج کرد. برای مثال، دانستن اینکه یک کلاس ``__getitem__``، ``__len__`` و ``__iter__`` را فراهم میکند، برای تمایز :class:`Sequence` از :class:`Mapping` کافی نیست."
msgid "These abstract classes now support ``[]``. See :ref:`types-genericalias` and :pep:`585`."
msgstr "این کلاسهای انتزاعی اکنون از ``[]`` پشتیبانی میکنند. :ref:`types-genericalias` و :pep:`585` را ببینید."
msgid "Collections Abstract Base Classes"
msgstr "کلاسهای پایه انتزاعی مجموعهها"
msgid "The collections module offers the following :term:`ABCs <abstract base class>`:"
msgstr "ماژول collections :term:`کلاسهای پایه انتزاعی <abstract base class>` زیر را ارائه میدهد:"
msgid "ABC"
msgstr "ABC"
msgid "Inherits from"
msgstr "به ارث میبرد از"
msgid "Abstract Methods"
msgstr "متدهای انتزاعی"
msgid "Mixin Methods"
msgstr "متدهای میکساین"
msgid ":class:`Container` [1]_"
msgstr ":class:`Container` [1]_"
msgid "``__contains__``"
msgstr "``__contains__``"
msgid ":class:`Hashable` [1]_"
msgstr ":class:`Hashable` [1]_"
msgid "``__hash__``"
msgstr "``__hash__``"
msgid ":class:`Iterable` [1]_ [2]_"
msgstr ":class:`Iterable` [1]_ [2]_"
msgid "``__iter__``"
msgstr "``__iter__``"
msgid ":class:`Iterator` [1]_"
msgstr ":class:`Iterator` [1]_"
msgid ":class:`Iterable`"
msgstr ":class:`Iterable`"
msgid "``__next__``"
msgstr "``__next__``"
msgid ":class:`Reversible` [1]_"
msgstr ":class:`Reversible` [1]_"
msgid "``__reversed__``"
msgstr "``__reversed__``"
msgid ":class:`Generator` [1]_"
msgstr ":class:`Generator` [1]_"
msgid ":class:`Iterator`"
msgstr ":class:`Iterator`"
msgid "``send``, ``throw``"
msgstr "``send``, ``throw``"
msgid "``close``, ``__iter__``, ``__next__``"
msgstr "``close``, ``__iter__``, ``__next__``"
msgid ":class:`Sized` [1]_"
msgstr ":class:`Sized` [1]_"
msgid "``__len__``"
msgstr "``__len__``"
msgid ":class:`Callable` [1]_"
msgstr ":class:`Callable` [1]_"
msgid "``__call__``"
msgstr "``__call__``"
msgid ":class:`Collection` [1]_"
msgstr ":class:`Collection` [1]_"
msgid ":class:`Sized`, :class:`Iterable`, :class:`Container`"
msgstr ":class:`Sized`, :class:`Iterable`, :class:`Container`"
msgid "``__contains__``, ``__iter__``, ``__len__``"
msgstr "``__contains__``, ``__iter__``, ``__len__``"
msgid ":class:`Sequence`"
msgstr ":class:`Sequence`"
msgid ":class:`Reversible`, :class:`Collection`"
msgstr ":class:`Reversible`, :class:`Collection`"
msgid "``__getitem__``, ``__len__``"
msgstr "``__getitem__``, ``__len__``"
msgid "``__contains__``, ``__iter__``, ``__reversed__``, ``index``, and ``count``"
msgstr "``__contains__``، ``__iter__``، ``__reversed__``، ``index`` و ``count``"
msgid ":class:`MutableSequence`"
msgstr ":class:`MutableSequence`"
msgid "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__len__``, ``insert``"
msgstr "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__len__``, ``insert``"
msgid "Inherited :class:`Sequence` methods and ``append``, ``clear``, ``reverse``, ``extend``, ``pop``, ``remove``, and ``__iadd__``"
msgstr "متدهای به ارث رسیده از :class:`Sequence` و ``append``، ``clear``، ``reverse``، ``extend``، ``pop``، ``remove`` و ``__iadd__``"
msgid ":class:`ByteString`"
msgstr ":class:`ByteString`"
msgid "Inherited :class:`Sequence` methods"
msgstr "متدهای موروثی :class:`Sequence`"
msgid ":class:`Set`"
msgstr ":class:`Set`"
msgid ":class:`Collection`"
msgstr ":class:`Collection`"
msgid "``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, ``__and__``, ``__or__``, ``__sub__``, ``__rsub__``, ``__xor__``, ``__rxor__`` and ``isdisjoint``"
msgstr "``__le__``، ``__lt__``، ``__eq__``، ``__ne__``، ``__gt__``، ``__ge__``، ``__and__``، ``__or__``، ``__sub__``، ``__rsub__``، ``__xor__``، ``__rxor__`` و ``isdisjoint``"
msgid ":class:`MutableSet`"
msgstr ":class:`MutableSet`"
msgid "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``"
msgstr "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``"
msgid "Inherited :class:`Set` methods and ``clear``, ``pop``, ``remove``, ``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__``"
msgstr "متدهای بهارثرسیده از :class:`Set` و ``clear``، ``pop``، ``remove``، ``__ior__``، ``__iand__``، ``__ixor__`` و ``__isub__``"
msgid ":class:`Mapping`"
msgstr ":class:`Mapping`"
msgid "``__getitem__``, ``__iter__``, ``__len__``"
msgstr "``__getitem__``, ``__iter__``, ``__len__``"
msgid "``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__``, and ``__ne__``"
msgstr "``__contains__``، ``keys``، ``items``، ``values``، ``get``، ``__eq__`` و ``__ne__``"
msgid ":class:`MutableMapping`"
msgstr ":class:`MutableMapping`"
msgid "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``"
msgstr "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``"
msgid "Inherited :class:`Mapping` methods and ``pop``, ``popitem``, ``clear``, ``update``, and ``setdefault``"
msgstr "متدهای بهارثرسیده از :class:`Mapping` و ``pop``، ``popitem``، ``clear``، ``update`` و ``setdefault``"
msgid ":class:`MappingView`"
msgstr ":class:`MappingView`"
msgid ":class:`Sized`"
msgstr ":class:`Sized`"
msgid "``__init__``, ``__len__`` and ``__repr__``"
msgstr "``__init__``، ``__len__`` و ``__repr__``"
msgid ":class:`ItemsView`"
msgstr ":class:`ItemsView`"
msgid ":class:`MappingView`, :class:`Set`"
msgstr ":class:`MappingView`, :class:`Set`"
msgid "``__contains__``, ``__iter__``"
msgstr "``__contains__``, ``__iter__``"
msgid ":class:`KeysView`"
msgstr ":class:`KeysView`"
msgid ":class:`ValuesView`"
msgstr ":class:`ValuesView`"
msgid ":class:`MappingView`, :class:`Collection`"
msgstr ":class:`MappingView`, :class:`Collection`"
msgid ":class:`Awaitable` [1]_"
msgstr ":class:`Awaitable` [1]_"
msgid "``__await__``"
msgstr "``__await__``"
msgid ":class:`Coroutine` [1]_"
msgstr ":class:`Coroutine` [1]_"
msgid ":class:`Awaitable`"
msgstr ":class:`Awaitable`"
msgid "``close``"
msgstr "``close``"
msgid ":class:`AsyncIterable` [1]_"
msgstr ":class:`AsyncIterable` [1]_"
msgid "``__aiter__``"
msgstr "``__aiter__``"
msgid ":class:`AsyncIterator` [1]_"
msgstr ":class:`AsyncIterator` [1]_"
msgid ":class:`AsyncIterable`"
msgstr ":class:`AsyncIterable`"
msgid "``__anext__``"
msgstr "``__anext__``"
msgid ":class:`AsyncGenerator` [1]_"
msgstr ":class:`AsyncGenerator` [1]_"
msgid ":class:`AsyncIterator`"
msgstr ":class:`AsyncIterator`"
msgid "``asend``, ``athrow``"
msgstr "``asend``, ``athrow``"
msgid "``aclose``, ``__aiter__``, ``__anext__``"
msgstr "``aclose``, ``__aiter__``, ``__anext__``"
msgid ":class:`Buffer` [1]_"
msgstr ":class:`Buffer` [1]_"
msgid "``__buffer__``"
msgstr "``__buffer__``"
msgid "Footnotes"
msgstr "پانویسها"
msgid "These ABCs override :meth:`~abc.ABCMeta.__subclasshook__` to support testing an interface by verifying the required methods are present and have not been set to :const:`None`. This only works for simple interfaces. More complex interfaces require registration or direct subclassing."
msgstr "این ABCها :meth:`~abc.ABCMeta.__subclasshook__` را بازنویسی میکنند تا با تأیید وجود متدهای مورد نیاز و تنظیم نشدن آنها به :const:`None`، امکان آزمودن یک رابط را فراهم کنند. این تنها برای رابطهای ساده کار میکند. رابطهای پیچیدهتر به ثبت یا زیرکلاسسازی مستقیم نیاز دارند."
msgid "Checking ``isinstance(obj, Iterable)`` detects classes that are registered as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but it does not detect classes that iterate with the :meth:`~object.__getitem__` method. The only reliable way to determine whether an object is :term:`iterable` is to call ``iter(obj)``."
msgstr "بررسی ``isinstance(obj, Iterable)`` کلاسهایی را که بهعنوان :class:`Iterable` ثبت شدهاند یا دارای متد :meth:`~container.__iter__` هستند تشخیص میدهد، اما کلاسهایی را که برای تکرار از متد :meth:`~object.__getitem__` استفاده میکنند تشخیص نمیدهد. تنها راه مطمئن برای تعیین اینکه آیا یک شیء :term:`پیمایشپذیر <iterable>` است، فراخوانی ``iter(obj)`` است."
msgid "Collections Abstract Base Classes -- Detailed Descriptions"
msgstr "کلاسهای پایه انتزاعی مجموعهها -- توضیحات تفصیلی"
msgid "ABC for classes that provide the :meth:`~object.__contains__` method."
msgstr "کلاس پایه انتزاعی (ABC) برای کلاسهایی که متد :meth:`~object.__contains__` را فراهم میکنند."
msgid "ABC for classes that provide the :meth:`~object.__hash__` method."
msgstr "کلاس پایه انتزاعی (ABC) برای کلاسهایی که متد :meth:`~object.__hash__` را ارائه میدهند."
msgid "ABC for classes that provide the :meth:`~object.__len__` method."
msgstr "کلاس پایه انتزاعی (ABC) برای کلاسهایی که متد :meth:`~object.__len__` را فراهم میکنند."
msgid "ABC for classes that provide the :meth:`~object.__call__` method."
msgstr "ABC برای کلاسهایی که متد :meth:`~object.__call__` را فراهم میکنند."
msgid "See :ref:`annotating-callables` for details on how to use :class:`!Callable` in type annotations."
msgstr "برای جزئیات دربارهی نحوهی استفاده از :class:`!Callable` در حاشیهنویسیهای نوع، :ref:`annotating-callables` را ببینید."
msgid "ABC for classes that provide the :meth:`~container.__iter__` method."
msgstr "کلاس پایه انتزاعی (ABC) برای کلاسهایی که متد :meth:`~container.__iter__` را فراهم میکنند."
msgid "Checking ``isinstance(obj, Iterable)`` detects classes that are registered as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but it does not detect classes that iterate with the :meth:`~object.__getitem__` method. The only reliable way to determine whether an object is :term:`iterable` is to call ``iter(obj)``."
msgstr "بررسی ``isinstance(obj, Iterable)`` کلاسهایی را که بهعنوان :class:`Iterable` ثبت شدهاند یا دارای متد :meth:`~container.__iter__` هستند تشخیص میدهد، اما کلاسهایی را که پیمایش آنها از طریق متد :meth:`~object.__getitem__` انجام میشود تشخیص نمیدهد. تنها راه قابلاطمینان برای تشخیص اینکه آیا یک شیء :term:`پیمایشپذیر <iterable>` است، فراخوانی ``iter(obj)`` است."
msgid "ABC for sized iterable container classes."
msgstr "کلاس پایه انتزاعی (ABC) برای کلاسهای ظرف اندازهدار و پیمایشپذیر."
msgid "ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:`~iterator.__next__` methods. See also the definition of :term:`iterator`."
msgstr "ABC برای کلاسهایی که متدهای :meth:`~iterator.__iter__` و :meth:`~iterator.__next__` را فراهم میکنند. همچنین تعریف :term:`iterator` را ببینید."
msgid "ABC for iterable classes that also provide the :meth:`~object.__reversed__` method."
msgstr "ABC برای کلاسهای پیمایشپذیری که متد :meth:`~object.__reversed__` را نیز ارائه میدهند."
msgid "ABC for :term:`generator` classes that implement the protocol defined in :pep:`342` that extends :term:`iterators <iterator>` with the :meth:`~generator.send`, :meth:`~generator.throw` and :meth:`~generator.close` methods."
msgstr "کلاس پایه انتزاعی (ABC) برای کلاسهای :term:`تولیدگر <generator>` که پروتکل تعریفشده در :pep:`342` را پیادهسازی میکنند؛ پروتکلی که :term:`پیمایشگرها <iterator>` را با متدهای :meth:`~generator.send`، :meth:`~generator.throw` و :meth:`~generator.close` گسترش میدهد."
msgid "See :ref:`annotating-generators-and-coroutines` for details on using :class:`!Generator` in type annotations."
msgstr "برای جزئیات درباره استفاده از :class:`!Generator` در حاشیهنویسیهای نوع، :ref:`annotating-generators-and-coroutines` را ببینید."
msgid "ABCs for read-only and mutable :term:`sequences <sequence>`."
msgstr "کلاسهای پایه انتزاعی (ABC) برای :term:`دنبالههای <sequence>` فقطخواندنی و تغییرپذیر."
msgid "Implementation note: Some of the mixin methods, such as :meth:`~container.__iter__`, :meth:`~object.__reversed__`, and :meth:`~sequence.index` make repeated calls to the underlying :meth:`~object.__getitem__` method. Consequently, if :meth:`~object.__getitem__` is implemented with constant access speed, the mixin methods will have linear performance; however, if the underlying method is linear (as it would be with a linked list), the mixins will have quadratic performance and will likely need to be overridden."
msgstr "یادداشت پیادهسازی: برخی از متدهای میکساین، مانند :meth:`~container.__iter__`، :meth:`~object.__reversed__` و :meth:`~sequence.index`، فراخوانیهای مکرری به متد زیربنایی :meth:`~object.__getitem__` انجام میدهند. در نتیجه، اگر :meth:`~object.__getitem__` با سرعت دسترسی ثابت پیادهسازی شده باشد، متدهای میکساین عملکرد خطی خواهند داشت؛ اما اگر متد زیربنایی خطی باشد (همانطور که در یک فهرست پیوندی اینگونه خواهد بود)، میکساینها عملکرد درجه دو خواهند داشت و احتمالاً لازم است بازنویسی شوند."
msgid "Return first index of *value*."
msgstr "نخستین اندیس *value* را برمیگرداند."
msgid "Raises :exc:`ValueError` if the value is not present."
msgstr "اگر مقدار موجود نباشد، :exc:`ValueError` پرتاب میشود."
msgid "Supporting the *start* and *stop* arguments is optional, but recommended."
msgstr "پشتیبانی از آرگومانهای *start* و *stop* اختیاری است، اما توصیه میشود."
msgid "The :meth:`~sequence.index` method gained support for the *stop* and *start* arguments."
msgstr "پشتیبانی از آرگومانهای *stop* و *start* به متد :meth:`~sequence.index` اضافه شد."
msgid "The :class:`ByteString` ABC has been deprecated."
msgstr "کلاس پایه انتزاعی (ABC) :class:`ByteString` منسوخ شده است."
msgid "Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` implements the :ref:`buffer protocol <bufferobjects>` at runtime. For use in type annotations, either use :class:`Buffer` or a union that explicitly specifies the types your code supports (e.g., ``bytes | bytearray | memoryview``)."
msgstr "برای بررسی اینکه ``obj`` :ref:`پروتکل بافر <bufferobjects>` را در زمان رانتایم پیادهسازی میکند، از ``isinstance(obj, collections.abc.Buffer)`` استفاده کنید. برای استفاده در حاشیهنویسیهای نوع، یا از :class:`Buffer` استفاده کنید یا از یک اجتماع (union) که بهصراحت انواع مورد پشتیبانی کد شما را مشخص میکند (مثلاً ``bytes | bytearray | memoryview``)."
msgid ":class:`!ByteString` was originally intended to be an abstract class that would serve as a supertype of both :class:`bytes` and :class:`bytearray`. However, since the ABC never had any methods, knowing that an object was an instance of :class:`!ByteString` never actually told you anything useful about the object. Other common buffer types such as :class:`memoryview` were also never understood as subtypes of :class:`!ByteString` (either at runtime or by static type checkers)."
msgstr ":class:`!ByteString` در ابتدا قرار بود یک کلاس انتزاعی باشد که بهعنوان نوع والد هر دو کلاس :class:`bytes` و :class:`bytearray` عمل کند. با این حال، از آنجا که این کلاس پایه انتزاعی هرگز هیچ متدی نداشت، دانستن اینکه یک شیء نمونهای از :class:`!ByteString` است، در عمل هرگز اطلاعات مفیدی دربارهی آن شیء به شما نمیداد. سایر انواع رایج بافر مانند :class:`memoryview` نیز هرگز بهعنوان زیرنوعهایی از :class:`!ByteString` در نظر گرفته نمیشدند (نه در رانتایم و نه توسط بررسیکنندههای نوع ایستا)."
msgid "See :pep:`PEP 688 <688#current-options>` for more details."
msgstr "برای جزئیات بیشتر :pep:`PEP 688 <688#current-options>` را ببینید."
msgid "ABCs for read-only and mutable :ref:`sets <types-set>`."
msgstr "کلاسهای پایه انتزاعی برای :ref:`مجموعههای فقطخواندنی و تغییرپذیر <types-set>`."
msgid "ABCs for read-only and mutable :term:`mappings <mapping>`."
msgstr "کلاسهای پایه انتزاعی برای :term:`نگاشتهای <mapping>` فقطخواندنی و تغییرپذیر."
msgid "ABCs for mapping, items, keys, and values :term:`views <dictionary view>`."
msgstr "کلاسهای پایه انتزاعی (ABCs) برای :term:`نماهای <dictionary view>` نگاشت، آیتمها، کلیدها و مقدارها."
msgid "ABC for :term:`awaitable` objects, which can be used in :keyword:`await` expressions. Custom implementations must provide the :meth:`~object.__await__` method."
msgstr "کلاس پایه انتزاعی (ABC) برای اشیاء :term:`awaitable`، که میتوان از آنها در عبارتهای :keyword:`await` استفاده کرد. پیادهسازیهای سفارشی باید متد :meth:`~object.__await__` را فراهم کنند."
msgid ":term:`Coroutine <coroutine>` objects and instances of the :class:`~collections.abc.Coroutine` ABC are all instances of this ABC."
msgstr "اشیاء :term:`همروال <coroutine>` و نمونههای کلاس پایه انتزاعی (ABC) :class:`~collections.abc.Coroutine`، همگی نمونههایی از این ABC هستند."
msgid "In CPython, generator-based coroutines (:term:`generators <generator>` decorated with :deco:`types.coroutine`) are *awaitables*, even though they do not have an :meth:`~object.__await__` method. Using ``isinstance(gencoro, Awaitable)`` for them will return ``False``. Use :func:`inspect.isawaitable` to detect them."
msgstr "در CPython، همروالهای مبتنی بر تولیدگر (:term:`تولیدگرها <generator>` که با :deco:`types.coroutine` دکور شدهاند) *awaitable* هستند، اگرچه متد :meth:`~object.__await__` ندارند. استفاده از ``isinstance(gencoro, Awaitable)`` برای آنها ``False`` را برمیگرداند. برای شناسایی آنها از :func:`inspect.isawaitable` استفاده کنید."
msgid "ABC for :term:`coroutine` compatible classes. These implement the following methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:`~coroutine.throw`, and :meth:`~coroutine.close`. Custom implementations must also implement :meth:`~object.__await__`. All :class:`Coroutine` instances are also instances of :class:`Awaitable`."
msgstr "ABC برای کلاسهای سازگار با :term:`همروال <coroutine>`. این کلاسها متدهای زیر را، که در :ref:`coroutine-objects` تعریف شدهاند، پیادهسازی میکنند: :meth:`~coroutine.send`، :meth:`~coroutine.throw` و :meth:`~coroutine.close`. پیادهسازیهای سفارشی باید :meth:`~object.__await__` را نیز پیادهسازی کنند. تمام نمونههای :class:`Coroutine` نیز نمونههایی از :class:`Awaitable` هستند."
msgid "In CPython, generator-based coroutines (:term:`generators <generator>` decorated with :deco:`types.coroutine`) are *awaitables*, even though they do not have an :meth:`~object.__await__` method. Using ``isinstance(gencoro, Coroutine)`` for them will return ``False``. Use :func:`inspect.isawaitable` to detect them."
msgstr "در CPython، همروالهای مبتنی بر تولیدگر (:term:`تولیدگرها <generator>` که با :deco:`types.coroutine` آراییده شدهاند) *awaitable* هستند، اگرچه آنها متد :meth:`~object.__await__` ندارند. استفاده از ``isinstance(gencoro, Coroutine)`` برای آنها ``False`` را برمیگرداند. برای تشخیص آنها از :func:`inspect.isawaitable` استفاده کنید."
msgid "See :ref:`annotating-generators-and-coroutines` for details on using :class:`!Coroutine` in type annotations. The variance and order of type parameters correspond to those of :class:`Generator`."
msgstr "برای جزئیات دربارهی استفاده از :class:`!Coroutine` در حاشیهنویسیهای نوع، :ref:`annotating-generators-and-coroutines` را ببینید. واریانس و ترتیب پارامترهای نوع، متناظر با موارد مربوط به :class:`Generator` است."
msgid "ABC for classes that provide an ``__aiter__`` method. See also the definition of :term:`asynchronous iterable`."
msgstr "ABC برای کلاسهایی که متد ``__aiter__`` را ارائه میدهند. همچنین تعریف :term:`پیمایشپذیر ناهمگام <asynchronous iterable>` را ببینید."
msgid "ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See also the definition of :term:`asynchronous iterator`."
msgstr "کلاس پایه انتزاعی (ABC) برای کلاسهایی که متدهای ``__aiter__`` و ``__anext__`` را فراهم میکنند. همچنین تعریف :term:`asynchronous iterator` را ببینید."
msgid "ABC for :term:`asynchronous generator` classes that implement the protocol defined in :pep:`525` and :pep:`492`."
msgstr "ABC برای کلاسهای :term:`asynchronous generator` که پروتکل تعریفشده در :pep:`525` و :pep:`492` را پیادهسازی میکنند."
msgid "See :ref:`annotating-generators-and-coroutines` for details on using :class:`!AsyncGenerator` in type annotations."
msgstr "برای جزئیات دربارهی استفاده از :class:`!AsyncGenerator` در حاشیهنویسیهای نوع، :ref:`annotating-generators-and-coroutines` را ببینید."
msgid "ABC for classes that provide the :meth:`~object.__buffer__` method, implementing the :ref:`buffer protocol <bufferobjects>`. See :pep:`688`."
msgstr "کلاس پایه انتزاعی (ABC) برای کلاسهایی که متد :meth:`~object.__buffer__` را ارائه میدهند و :ref:`پروتکل بافر <bufferobjects>` را پیادهسازی میکنند. :pep:`688` را ببینید."
msgid "Examples and Recipes"
msgstr "مثالها و راهکارها"
msgid "ABCs allow us to ask classes or instances if they provide particular functionality, for example::"
msgstr "کلاسهای پایه انتزاعی (ABCs) به ما امکان میدهند از کلاسها یا نمونهها بپرسیم که آیا قابلیت خاصی را فراهم میکنند یا خیر، برای مثال::"
msgid ""
"size = None\n"
"if isinstance(myvar, collections.abc.Sized):\n"
" size = len(myvar)"
msgstr ""
"size = None\n"
"if isinstance(myvar, collections.abc.Sized):\n"
" size = len(myvar)"
msgid "Several of the ABCs are also useful as mixins that make it easier to develop classes supporting container APIs. For example, to write a class supporting the full :class:`Set` API, it is only necessary to supply the three underlying abstract methods: :meth:`~object.__contains__`, :meth:`~container.__iter__`, and :meth:`~object.__len__`. The ABC supplies the remaining methods such as :meth:`!__and__` and :meth:`~frozenset.isdisjoint`::"
msgstr "برخی از کلاسهای پایه انتزاعی (ABC) نیز بهعنوان میکساین مفید هستند و توسعه کلاسهایی را که از APIهای ظرف پشتیبانی میکنند، آسانتر میکنند. برای مثال، برای نوشتن کلاسی که از API کامل :class:`Set` پشتیبانی میکند، تنها لازم است سه متد انتزاعی زیربنایی را فراهم کنید: :meth:`~object.__contains__`، :meth:`~container.__iter__` و :meth:`~object.__len__`. ABC متدهای باقیمانده مانند :meth:`!__and__` و :meth:`~frozenset.isdisjoint` را فراهم میکند::"
msgid ""
"class ListBasedSet(collections.abc.Set):\n"
" ''' Alternate set implementation favoring space over speed\n"
" and not requiring the set elements to be hashable. '''\n"
" def __init__(self, iterable):\n"
" self.elements = lst = []\n"
" for value in iterable:\n"
" if value not in lst:\n"
" lst.append(value)\n"
"\n"
" def __iter__(self):\n"
" return iter(self.elements)\n"
"\n"
" def __contains__(self, value):\n"
" return value in self.elements\n"
"\n"
" def __len__(self):\n"
" return len(self.elements)\n"
"\n"
"s1 = ListBasedSet('abcdef')\n"
"s2 = ListBasedSet('defghi')\n"
"overlap = s1 & s2 # The __and__() method is supported automatically"
msgstr ""
"class ListBasedSet(collections.abc.Set):\n"
" ''' Alternate set implementation favoring space over speed\n"
" and not requiring the set elements to be hashable. '''\n"
" def __init__(self, iterable):\n"
" self.elements = lst = []\n"
" for value in iterable:\n"
" if value not in lst:\n"
" lst.append(value)\n"
"\n"
" def __iter__(self):\n"
" return iter(self.elements)\n"
"\n"
" def __contains__(self, value):\n"
" return value in self.elements\n"
"\n"
" def __len__(self):\n"
" return len(self.elements)\n"
"\n"
"s1 = ListBasedSet('abcdef')\n"
"s2 = ListBasedSet('defghi')\n"
"overlap = s1 & s2 # The __and__() method is supported automatically"
msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:"
msgstr "نکاتی دربارهی استفاده از :class:`Set` و :class:`MutableSet` بهعنوان میکساین :"
msgid "Since some set operations create new sets, the default mixin methods need a way to create new instances from an :term:`iterable`. The class constructor is assumed to have a signature in the form ``ClassName(iterable)``. That assumption is factored-out to an internal :class:`classmethod` called :meth:`!_from_iterable` which calls ``cls(iterable)`` to produce a new set. If the :class:`Set` mixin is being used in a class with a different constructor signature, you will need to override :meth:`!_from_iterable` with a classmethod or regular method that can construct new instances from an iterable argument."
msgstr "از آنجا که برخی از عملیات مجموعهای، مجموعههای جدیدی ایجاد میکنند، متدهای پیشفرض میکساین به راهی برای ایجاد نمونههای جدید از یک :term:`پیمایشپذیر <iterable>` نیاز دارند. فرض میشود که سازندهی کلاس، امضایی به شکل ``ClassName(iterable)`` داشته باشد. این فرض در قالب یک :class:`classmethod` داخلی به نام :meth:`!_from_iterable` استخراج شده است که ``cls(iterable)`` را فراخوانی میکند تا یک مجموعه جدید تولید کند. اگر از میکساین :class:`Set` در کلاسی با امضای سازنده متفاوت استفاده شود، لازم است :meth:`!_from_iterable` را با یک classmethod یا متد معمولی که بتواند نمونههای جدید را از یک آرگومان پیمایشپذیر بسازد، بازنویسی کنید."
msgid "To override the comparisons (presumably for speed, as the semantics are fixed), redefine :meth:`~object.__le__` and :meth:`~object.__ge__`, then the other operations will automatically follow suit."
msgstr "برای بازنویسی مقایسهها (احتمالاً برای سرعت، زیرا معنای آنها ثابت است)، :meth:`~object.__le__` و :meth:`~object.__ge__` را بازتعریف کنید؛ سپس سایر عملیات بهطور خودکار از آنها پیروی خواهند کرد."
msgid "The :class:`Set` mixin provides a :meth:`!_hash` method to compute a hash value for the set; however, :meth:`~object.__hash__` is not defined because not all sets are :term:`hashable` or immutable. To add set hashability using mixins, inherit from both :class:`Set` and :class:`Hashable`, then define ``__hash__ = Set._hash``."
msgstr "میکساین :class:`Set` یک متد :meth:`!_hash` برای محاسبهی مقدار هش مجموعه ارائه میکند؛ با این حال، :meth:`~object.__hash__` تعریف نشده است، زیرا همهی مجموعهها :term:`هشپذیر <hashable>` یا تغییرناپذیر نیستند. برای افزودن هشپذیری مجموعه با استفاده از میکساینها، از هر دو :class:`Set` و :class:`Hashable` ارثبری کنید، سپس ``__hash__ = Set._hash`` را تعریف کنید."
msgid "`OrderedSet recipe <https://code.activestate.com/recipes/576694/>`_ for an example built on :class:`MutableSet`."
msgstr "`دستور پخت OrderedSet <https://code.activestate.com/recipes/576694/>`_ برای نمونهای که بر پایهی :class:`MutableSet` ساخته شده است."
msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`."
msgstr "برای اطلاعات بیشتر درباره ABCها، ماژول :mod:`abc` و :pep:`3119` را ببینید."