-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathexecutionmodel.po
More file actions
518 lines (373 loc) · 61.4 KB
/
Copy pathexecutionmodel.po
File metadata and controls
518 lines (373 loc) · 61.4 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
# 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
# Danial Behzadi <dani.behzi@ubuntu.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-11 17:29+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 "Execution model"
msgstr "مدل اجرا"
msgid "Structure of a program"
msgstr "ساختار یک برنامه"
msgid "A Python program is constructed from code blocks. A :dfn:`block` is a piece of Python program text that is executed as a unit. The following are blocks: a module, a function body, and a class definition. Each command typed interactively is a block. A script file (a file given as standard input to the interpreter or specified as a command line argument to the interpreter) is a code block. A script command (a command specified on the interpreter command line with the :option:`-c` option) is a code block. A module run as a top level script (as module ``__main__``) from the command line using a :option:`-m` argument is also a code block. The string argument passed to the built-in functions :func:`eval` and :func:`exec` is a code block."
msgstr "یک برنامه پایتون از بلوکهای کد ساخته شده است. یک :dfn:`بلوک (block)` بخشی از متن برنامه پایتون است که بهعنوان یک واحد اجرا میشود. موارد زیر بلوک هستند: ماژول، بدنه تابع، و تعریف کلاس. هر دستوری که بهصورت تعاملی تایپ شود یک بلوک است. یک پرونده اسکریپت (پروندهای که بهعنوان ورودی استاندارد به مفسر داده شود یا بهعنوان آرگومان خط فرمان برای مفسر مشخص شود) یک بلوک کد است. یک دستور اسکریپت (دستوری که در خط فرمان مفسر با گزینه :option:`-c` مشخص شده است) یک بلوک کد است. ماژولی که بهعنوان اسکریپت سطح بالا (بهعنوان ماژول ``__main__``) از خط فرمان با استفاده از آرگومان :option:`-m` اجرا میشود نیز یک بلوک کد است. آرگومان رشتهای که به توابع توکار :func:`eval` و :func:`exec` داده میشود یک بلوک کد است."
msgid "A code block is executed in an :dfn:`execution frame`. A frame contains some administrative information (used for debugging) and determines where and how execution continues after the code block's execution has completed."
msgstr "یک بلوک کد در یک :dfn:`فریم اجرا (execution frame)` اجرا میشود. یک فریم شامل برخی اطلاعات مدیریتی (که برای اشکالزدایی استفاده میشود) است و تعیین میکند که پس از تکمیل اجرای بلوک کد، اجرا در کجا و چگونه ادامه یابد."
msgid "Naming and binding"
msgstr "نامگذاری و مقیدسازی"
msgid "Binding of names"
msgstr "پیوند نامها"
msgid ":dfn:`Names` refer to objects. Names are introduced by name binding operations."
msgstr ":dfn:`نامها (Names)` به اشیاء اشاره میکنند. نامها توسط عملیات مقیدسازی نام معرفی میشوند."
msgid "The following constructs bind names:"
msgstr "سازههای زیر نامها را مقید میکنند:"
msgid "formal parameters to functions,"
msgstr "پارامترهای صوری توابع،"
msgid "class definitions,"
msgstr "تعاریف کلاس،"
msgid "function definitions,"
msgstr "تعریف توابع،"
msgid "assignment expressions,"
msgstr "عبارتهای انتساب،"
msgid ":ref:`targets <assignment>` that are identifiers if occurring in an assignment:"
msgstr ":ref:`اهداف <assignment>` که اگر در یک انتساب ظاهر شوند، شناسه هستند:"
msgid ":keyword:`for` loop header,"
msgstr "سرآیند حلقهی :keyword:`for`،"
msgid "after :keyword:`!as` in a :keyword:`with` statement, :keyword:`except` clause, :keyword:`except* <except_star>` clause, or in the as-pattern in structural pattern matching,"
msgstr "پس از :keyword:`!as` در یک دستور :keyword:`with`، بند :keyword:`except`، بند :keyword:`except* <except_star>`، یا در الگوی as در تطبیق الگوی ساختاری،"
msgid "in a capture pattern in structural pattern matching"
msgstr "در یک الگوی ثبتکننده (capture pattern) در تطبیق الگوی ساختاری"
msgid ":keyword:`import` statements."
msgstr "دستورهای :keyword:`import`."
msgid ":keyword:`type` statements."
msgstr "دستورهای :keyword:`type`."
msgid ":ref:`type parameter lists <type-params>`."
msgstr ":ref:`فهرستهای پارامتر نوع <type-params>`."
msgid "The :keyword:`!import` statement of the form ``from ... import *`` binds all names defined in the imported module, except those beginning with an underscore. This form may only be used at the module level."
msgstr "دستور :keyword:`!import` به شکل ``from ... import *`` همهی نامهای تعریفشده در ماژول ایمپورتشده را مقید میکند، بهجز آنهایی که با یک زیرخط آغاز میشوند. این شکل فقط میتواند در سطح ماژول استفاده شود."
msgid "A target occurring in a :keyword:`del` statement is also considered bound for this purpose (though the actual semantics are to unbind the name)."
msgstr "هدفی که در یک دستور :keyword:`del` ظاهر میشود نیز برای این منظور مقید در نظر گرفته میشود (هرچند معنای واقعی آن آزاد کردن نام است)."
msgid "Each assignment or import statement occurs within a block defined by a class or function definition or at the module level (the top-level code block)."
msgstr "هر دستور انتساب یا ایمپورت درون بلوکی رخ میدهد که با تعریف یک کلاس یا تابع تعریف شده است، یا در سطح ماژول (بلوک کد سطح بالا)."
msgid "If a name is bound in a block, it is a local variable of that block, unless declared as :keyword:`nonlocal` or :keyword:`global`. If a name is bound at the module level, it is a global variable. (The variables of the module code block are local and global.) If a variable is used in a code block but not defined there, it is a :term:`free variable`."
msgstr "اگر نامی در یک بلوک مقید شود، یک متغیر محلی آن بلوک است، مگر اینکه بهعنوان :keyword:`nonlocal` یا :keyword:`global` اعلام شده باشد. اگر نامی در سطح ماژول مقید شود، یک متغیر سراسری است. (متغیرهای بلوک کد ماژول هم محلی و هم سراسری هستند.) اگر متغیری در یک بلوک کد استفاده شود اما در آنجا تعریف نشده باشد، یک :term:`متغیر آزاد <free variable>` است."
msgid "Each occurrence of a name in the program text refers to the :dfn:`binding` of that name established by the following name resolution rules."
msgstr "هر ظهور یک نام در متن برنامه به :dfn:`پیوند (binding)` آن نام اشاره دارد که بر اساس قواعد حل نام زیر برقرار شده است."
msgid "Resolution of names"
msgstr "حل نامها"
msgid "A :dfn:`scope` defines the visibility of a name within a block. If a local variable is defined in a block, its scope includes that block. If the definition occurs in a function block, the scope extends to any blocks contained within the defining one, unless a contained block introduces a different binding for the name."
msgstr "یک :dfn:`محدوده (scope)` قابلیت مشاهدهی یک نام درون یک بلوک را تعریف میکند. اگر یک متغیر محلی در یک بلوک تعریف شود، محدودهی آن شامل آن بلوک میشود. اگر تعریف در یک بلوک تابع انجام شود، محدوده به هر بلوکی که درون بلوک تعریفکننده قرار دارد گسترش مییابد، مگر اینکه بلوکی درون آن، مقیدسازی متفاوتی برای آن نام ایجاد کند."
msgid "When a name is used in a code block, it is resolved using the nearest enclosing scope. The set of all such scopes visible to a code block is called the block's :dfn:`environment`."
msgstr "هنگامی که از یک نام در یک بلوک کد استفاده میشود، آن نام با استفاده از نزدیکترین محدودهی دربرگیرنده تعیین میشود. مجموعهی همهی چنین محدودههایی که برای یک بلوک کد قابل مشاهده هستند، :dfn:`محیط (environment)` آن بلوک نامیده میشود."
msgid "When a name is not found at all, a :exc:`NameError` exception is raised. If the current scope is a function scope, and the name refers to a local variable that has not yet been bound to a value at the point where the name is used, an :exc:`UnboundLocalError` exception is raised. :exc:`UnboundLocalError` is a subclass of :exc:`NameError`."
msgstr "هنگامی که نامی بههیچوجه پیدا نشود، یک استثنای :exc:`NameError` پرتاب میشود. اگر محدوده فعلی یک محدوده تابع باشد و نام به متغیر محلی اشاره کند که هنوز در نقطهای که نام استفاده میشود به مقداری متصل نشده باشد، یک استثنای :exc:`UnboundLocalError` پرتاب میشود. :exc:`UnboundLocalError` زیرکلاسی از :exc:`NameError` است."
msgid "If a name binding operation occurs anywhere within a code block, all uses of the name within the block are treated as references to the current block. This can lead to errors when a name is used within a block before it is bound. This rule is subtle. Python lacks declarations and allows name binding operations to occur anywhere within a code block. The local variables of a code block can be determined by scanning the entire text of the block for name binding operations. See :ref:`the FAQ entry on UnboundLocalError <faq-unboundlocalerror>` for examples."
msgstr "اگر یک عملیات مقیدسازی نام در هر جایی از یک بلوک کد رخ دهد، همهی استفادههای آن نام در آن بلوک بهعنوان ارجاعهایی به بلوک جاری در نظر گرفته میشوند. این موضوع میتواند در مواردی که یک نام در یک بلوک پیش از مقید شدن استفاده شود، منجر به خطا شود. این قاعده ظریف است. پایتون فاقد اعلان است و اجازه میدهد عملیات مقیدسازی نام در هر جایی از یک بلوک کد رخ دهد. متغیرهای محلی یک بلوک کد را میتوان با پویش کل متن بلوک برای یافتن عملیات مقیدسازی نام تعیین کرد. برای نمونهها، :ref:`مدخل پرسشهای متداول در مورد UnboundLocalError <faq-unboundlocalerror>` را ببینید."
msgid "If the :keyword:`global` statement occurs within a block, all uses of the names specified in the statement refer to the bindings of those names in the top-level namespace. Names are resolved in the top-level namespace by searching the global namespace, i.e. the namespace of the module containing the code block, and the builtins namespace, the namespace of the module :mod:`builtins`. The global namespace is searched first. If the names are not found there, the builtins namespace is searched next. If the names are also not found in the builtins namespace, new variables are created in the global namespace. The global statement must precede all uses of the listed names."
msgstr "اگر دستور :keyword:`global` درون یک بلوک رخ دهد، تمام موارد استفاده از نامهای مشخصشده در دستور به مقیدسازیهای آن نامها در فضای نام سطح بالا ارجاع میکنند. نامها در فضای نام سطح بالا با جستجوی فضای نام سراسری، یعنی فضای نام ماژول حاوی بلوک کد، و فضای نام builtins، یعنی فضای نام ماژول :mod:`builtins`، تعیین میشوند. ابتدا فضای نام سراسری جستجو میشود. اگر نامها در آنجا یافت نشدند، سپس فضای نام builtins جستجو میشود. اگر نامها در فضای نام builtins نیز یافت نشدند، متغیرهای جدیدی در فضای نام سراسری ایجاد میشوند. دستور global باید پیش از تمام موارد استفاده از نامهای فهرستشده بیاید."
msgid "The :keyword:`global` statement has the same scope as a name binding operation in the same block. If the nearest enclosing scope for a free variable contains a global statement, the free variable is treated as a global."
msgstr "دستور :keyword:`global` همان محدودهی یک عملیات مقیدسازی نام در همان بلوک را دارد. اگر نزدیکترین محدودهی دربرگیرنده برای یک متغیر آزاد شامل یک دستور global باشد، آن متغیر آزاد بهعنوان یک متغیر سراسری در نظر گرفته میشود."
msgid "The :keyword:`nonlocal` statement causes corresponding names to refer to previously bound variables in the nearest enclosing function scope. :exc:`SyntaxError` is raised at compile time if the given name does not exist in any enclosing function scope. :ref:`Type parameters <type-params>` cannot be rebound with the :keyword:`!nonlocal` statement."
msgstr "دستور :keyword:`nonlocal` باعث میشود نامهای مربوطه به متغیرهای از پیش مقیدشده در نزدیکترین محدوده تابع دربرگیرنده ارجاع دهند. اگر نام دادهشده در هیچ محدوده تابع دربرگیرندهای وجود نداشته باشد، :exc:`SyntaxError` در زمان کامپایل پرتاب میشود. :ref:`پارامترهای نوع <type-params>` نمیتوانند با دستور :keyword:`!nonlocal` دوباره مقید شوند."
msgid "The namespace for a module is automatically created the first time a module is imported. The main module for a script is always called :mod:`__main__`."
msgstr "فضای نام یک ماژول بهطور خودکار در اولین باری که یک ماژول ایمپورت میشود ایجاد میشود. ماژول اصلی یک اسکریپت همیشه :mod:`__main__` نامیده میشود."
msgid "Class definition blocks and arguments to :func:`exec` and :func:`eval` are special in the context of name resolution. A class definition is an executable statement that may use and define names. These references follow the normal rules for name resolution with an exception that unbound local variables are looked up in the global namespace. The namespace of the class definition becomes the attribute dictionary of the class. The scope of names defined in a class block is limited to the class block; it does not extend to the code blocks of methods. This includes comprehensions and generator expressions, but it does not include :ref:`annotation scopes <annotation-scopes>`, which have access to their enclosing class scopes. This means that the following will fail::"
msgstr "بلوکهای تعریف کلاس و آرگومانهای :func:`exec` و :func:`eval` در زمینهی حل نام خاص هستند. تعریف کلاس یک دستور قابل اجرا است که ممکن است از نامها استفاده کند و آنها را تعریف کند. این ارجاعها از قوانین عادی وضوح نام پیروی میکنند، با این استثنا که متغیرهای محلی مقیدنشده در فضای نام سراسری جستجو میشوند. فضای نام تعریف کلاس به دیکشنری ویژگیهای کلاس تبدیل میشود. محدودهی نامهای تعریفشده در یک بلوک کلاس به همان بلوک کلاس محدود است؛ این محدوده به بلوکهای کد متدها گسترش نمییابد. این شامل درکها و عبارات تولیدگر میشود، اما شامل :ref:`محدودههای annotation <annotation-scopes>` نمیشود، که به محدودههای کلاس دربرگیرنده خود دسترسی دارند. این بدان معناست که کد زیر شکست خواهد خورد::"
msgid ""
"class A:\n"
" a = 42\n"
" b = list(a + i for i in range(10))"
msgstr ""
"class A:\n"
" a = 42\n"
" b = list(a + i for i in range(10))"
msgid "However, the following will succeed::"
msgstr "با این حال، موارد زیر موفق خواهند بود::"
msgid ""
"class A:\n"
" type Alias = Nested\n"
" class Nested: pass\n"
"\n"
"print(A.Alias.__value__) # <type 'A.Nested'>"
msgstr ""
"class A:\n"
" type Alias = Nested\n"
" class Nested: pass\n"
"\n"
"print(A.Alias.__value__) # <type 'A.Nested'>"
msgid "Annotation scopes"
msgstr "محدودههای حاشیهنویسی"
msgid ":term:`Annotations <annotation>`, :ref:`type parameter lists <type-params>` and :keyword:`type` statements introduce *annotation scopes*, which behave mostly like function scopes, but with some exceptions discussed below."
msgstr ":term:`حاشیهنویسیها <annotation>`، :ref:`فهرستهای پارامتر نوع <type-params>` و دستورات :keyword:`type`، *محدودههای حاشیهنویسی* را معرفی میکنند که عمدتاً مانند محدودههای تابع رفتار میکنند، اما با چند استثنا که در زیر توضیح داده شدهاند."
msgid "Annotation scopes are used in the following contexts:"
msgstr "محدودههای حاشیهنویسی در زمینههای زیر استفاده میشوند:"
msgid ":term:`Function annotations <function annotation>`."
msgstr ":term:`حاشیهنویسیهای تابع <function annotation>`."
msgid ":term:`Variable annotations <variable annotation>`."
msgstr ":term:`حاشیهنویسیهای متغیر <variable annotation>`."
msgid "Type parameter lists for :ref:`generic type aliases <generic-type-aliases>`."
msgstr "فهرستهای پارامترهای نوع برای :ref:`نامهای مستعار نوع عام <generic-type-aliases>`."
msgid "Type parameter lists for :ref:`generic functions <generic-functions>`. A generic function's annotations are executed within the annotation scope, but its defaults and decorators are not."
msgstr "فهرستهای پارامتر نوع برای :ref:`توابع عام <generic-functions>`. حاشیهنویسیهای یک تابع عام در محدودهی حاشیهنویسی اجرا میشوند، اما مقادیر پیشفرض و دکوراتورهای آن در این محدوده اجرا نمیشوند."
msgid "Type parameter lists for :ref:`generic classes <generic-classes>`. A generic class's base classes and keyword arguments are executed within the annotation scope, but its decorators are not."
msgstr "فهرستهای پارامتر نوع برای :ref:`کلاسهای عام <generic-classes>`. کلاسهای پایه و آرگومانهای کلیدواژهای یک کلاس عام در محدودهی حاشیهنویسی اجرا میشوند، اما دکوراتورهای آن در این محدوده اجرا نمیشوند."
msgid "The bounds, constraints, and default values for type parameters (:ref:`lazily evaluated <lazy-evaluation>`)."
msgstr "کرانها، محدودیتها و مقادیر پیشفرض برای پارامترهای نوع (:ref:`ارزیابی تنبلانه <lazy-evaluation>`)."
msgid "The value of type aliases (:ref:`lazily evaluated <lazy-evaluation>`)."
msgstr "مقدار ناممستعارهای نوع (:ref:`ارزیابیشده بهصورت تنبل <lazy-evaluation>`)."
msgid "Annotation scopes differ from function scopes in the following ways:"
msgstr "محدودههای annotation به روشهای زیر با محدودههای تابع تفاوت دارند:"
msgid "Annotation scopes have access to their enclosing class namespace. If an annotation scope is immediately within a class scope, or within another annotation scope that is immediately within a class scope, the code in the annotation scope can use names defined in the class scope as if it were executed directly within the class body. This contrasts with regular functions defined within classes, which cannot access names defined in the class scope."
msgstr "محدودههای annotation (annotation scope) به فضای نام کلاس دربرگیرندهی خود دسترسی دارند. اگر یک محدودهی annotation بلافاصله درون یک محدودهی کلاس، یا درون یک محدودهی annotation دیگر که خود بلافاصله درون یک محدودهی کلاس قرار داشته باشد، کد درون محدودهی annotation میتواند از نامهای تعریفشده در محدودهی کلاس استفاده کند، گویی مستقیماً درون بدنهی کلاس اجرا شده است. این در تضاد با توابع معمولی تعریفشده درون کلاسها است؛ آنها نمیتوانند به نامهای تعریفشده در محدودهی کلاس دسترسی داشته باشند."
msgid "Expressions in annotation scopes cannot contain :keyword:`yield`, ``yield from``, :keyword:`await`, or :token:`:= <python-grammar:assignment_expression>` expressions. (These expressions are allowed in other scopes contained within the annotation scope.)"
msgstr "در محدودههای حاشیهنویسی، عبارتها نمیتوانند شامل :keyword:`yield`، ``yield from``، :keyword:`await` یا عبارتهای :token:`:= <python-grammar:assignment_expression>` باشند. (این عبارتها در سایر محدودههایی که در محدوده حاشیهنویسی قرار دارند، مجاز هستند.)"
msgid "Names defined in annotation scopes cannot be rebound with :keyword:`nonlocal` statements in inner scopes. This includes only type parameters, as no other syntactic elements that can appear within annotation scopes can introduce new names."
msgstr "نامهای تعریفشده در محدودههای حاشیهنویسی را نمیتوان با دستورهای :keyword:`nonlocal` در محدودههای داخلی دوباره مقید کرد. این نامها فقط شامل پارامترهای نوع میشوند، زیرا هیچ عنصر نحوی دیگری که بتواند در محدودههای حاشیهنویسی ظاهر شود، نمیتواند نامهای جدیدی معرفی کند."
msgid "While annotation scopes have an internal name, that name is not reflected in the :term:`qualified name` of objects defined within the scope. Instead, the :attr:`~definition.__qualname__` of such objects is as if the object were defined in the enclosing scope."
msgstr "در حالی که محدودههای annotation (annotation scopes) یک نام داخلی دارند، آن نام در :term:`qualified name` اشیای تعریفشده در محدوده منعکس نمیشود. در عوض، :attr:`~definition.__qualname__` چنین اشیایی بهگونهای است که گویی شیء در محدوده دربرگیرنده تعریفشده باشد."
msgid "Annotation scopes were introduced in Python 3.12 as part of :pep:`695`."
msgstr "محدودههای حاشیهنویسی (annotation scopes) در پایتون 3.12 بهعنوان بخشی از :pep:`695` معرفی شدند."
msgid "Annotation scopes are also used for type parameter defaults, as introduced by :pep:`696`."
msgstr "محدودههای حاشیهنویسی همچنین برای مقادیر پیشفرض پارامترهای نوع استفاده میشوند، همانطور که در :pep:`696` معرفی شده است."
msgid "Annotation scopes are now also used for annotations, as specified in :pep:`649` and :pep:`749`."
msgstr "محدودههای حاشیهنویسی اکنون برای حاشیهنویسیها نیز به کار میروند، همانطور که در :pep:`649` و :pep:`749` مشخص شده است."
msgid "Lazy evaluation"
msgstr "ارزیابی تنبل"
msgid "Most annotation scopes are *lazily evaluated*. This includes annotations, the values of type aliases created through the :keyword:`type` statement, and the bounds, constraints, and default values of type variables created through the :ref:`type parameter syntax <type-params>`. This means that they are not evaluated when the type alias or type variable is created, or when the object carrying annotations is created. Instead, they are only evaluated when necessary, for example when the ``__value__`` attribute on a type alias is accessed."
msgstr "بیشتر محدودههای حاشیهنویسی *بهصورت تنبل ارزیابی میشوند*. این شامل حاشیهنویسیها، مقدارهای نامهای مستعار نوع ایجادشده از طریق دستور :keyword:`type`، و کرانها، قیدها و مقدارهای پیشفرض متغیرهای نوع ایجادشده از طریق :ref:`سینتکس پارامترهای نوع <type-params>` میشود. این بدان معناست که آنها هنگام ایجاد نام مستعار نوع یا متغیر نوع، یا هنگام ایجاد شیء حامل حاشیهنویسیها ارزیابی نمیشوند. در عوض، آنها فقط در صورت لزوم ارزیابی میشوند، برای مثال، زمانی که به ویژگی ``__value__`` یک نام مستعار نوع دسترسی پیدا میشود."
msgid "Example:"
msgstr "مثال:"
msgid ""
">>> type Alias = 1/0\n"
">>> Alias.__value__\n"
"Traceback (most recent call last):\n"
" ...\n"
"ZeroDivisionError: division by zero\n"
">>> def func[T: 1/0](): pass\n"
">>> T = func.__type_params__[0]\n"
">>> T.__bound__\n"
"Traceback (most recent call last):\n"
" ...\n"
"ZeroDivisionError: division by zero"
msgstr ""
">>> type Alias = 1/0\n"
">>> Alias.__value__\n"
"Traceback (most recent call last):\n"
" ...\n"
"ZeroDivisionError: division by zero\n"
">>> def func[T: 1/0](): pass\n"
">>> T = func.__type_params__[0]\n"
">>> T.__bound__\n"
"Traceback (most recent call last):\n"
" ...\n"
"ZeroDivisionError: division by zero"
msgid "Here the exception is raised only when the ``__value__`` attribute of the type alias or the ``__bound__`` attribute of the type variable is accessed."
msgstr "در اینجا استثنا تنها زمانی پرتاب میشود که به ویژگی ``__value__`` نام مستعار نوع یا ویژگی ``__bound__`` متغیر نوع دسترسی پیدا شود."
msgid "This behavior is primarily useful for references to types that have not yet been defined when the type alias or type variable is created. For example, lazy evaluation enables creation of mutually recursive type aliases::"
msgstr "این رفتار عمدتاً برای ارجاع به انواعی مفید است که هنوز در زمان ایجاد نام مستعار نوع یا متغیر نوع تعریف نشدهاند. برای مثال، ارزیابی تنبل امکان ایجاد نامهای مستعار نوع بازگشتی متقابل را فراهم میکند::"
msgid ""
"from typing import Literal\n"
"\n"
"type SimpleExpr = int | Parenthesized\n"
"type Parenthesized = tuple[Literal[\"(\"], Expr, Literal[\")\"]]\n"
"type Expr = SimpleExpr | tuple[SimpleExpr, Literal[\"+\", \"-\"], Expr]"
msgstr ""
"from typing import Literal\n"
"\n"
"type SimpleExpr = int | Parenthesized\n"
"type Parenthesized = tuple[Literal[\"(\"], Expr, Literal[\")\"]]\n"
"type Expr = SimpleExpr | tuple[SimpleExpr, Literal[\"+\", \"-\"], Expr]"
msgid "Lazily evaluated values are evaluated in :ref:`annotation scope <annotation-scopes>`, which means that names that appear inside the lazily evaluated value are looked up as if they were used in the immediately enclosing scope."
msgstr "مقادیری که بهصورت تنبل ارزیابی میشوند، در :ref:`محدوده حاشیهنویسی (annotation scope) <annotation-scopes>` ارزیابی میشوند، به این معنا که نامهایی که درون مقدار با ارزیابی تنبل ظاهر میشوند، بهگونهای جستجو میشوند که گویی در محدوده دربرگیرنده مستقیم استفاده شدهاند."
msgid "Builtins and restricted execution"
msgstr "توکارها و اجرای محدود"
msgid "Users should not touch ``__builtins__``; it is strictly an implementation detail. Users wanting to override values in the builtins namespace should :keyword:`import` the :mod:`builtins` module and modify its attributes appropriately."
msgstr "کاربران نباید ``__builtins__`` را دستکاری کنند؛ این صرفاً یک جزئیات پیادهسازی است. کاربرانی که میخواهند مقادیر موجود در فضای نام builtins را بازنویسی کنند، باید ماژول :mod:`builtins` را :keyword:`import` کنند و ویژگیهای آن را بهطور مناسب تغییر دهند."
msgid "The builtins namespace associated with the execution of a code block is actually found by looking up the name ``__builtins__`` in its global namespace; this should be a dictionary or a module (in the latter case the module's dictionary is used). By default, when in the :mod:`__main__` module, ``__builtins__`` is the built-in module :mod:`builtins`; when in any other module, ``__builtins__`` is an alias for the dictionary of the :mod:`builtins` module itself."
msgstr "فضای نام builtins مرتبط با اجرای یک بلوک کد، در واقع با جستجوی نام ``__builtins__`` در فضای نام سراسری آن یافت میشود؛ این باید یک دیکشنری یا یک ماژول باشد (در حالت دوم، از دیکشنری آن ماژول استفاده میشود). بهطور پیشفرض، هنگامی که در ماژول :mod:`__main__` هستید، ``__builtins__`` ماژول توکار :mod:`builtins` است؛ هنگامی که در هر ماژول دیگری هستید، ``__builtins__`` نام مستعاری برای دیکشنری خود ماژول :mod:`builtins` است."
msgid "Interaction with dynamic features"
msgstr "تعامل با ویژگیهای پویا"
msgid "Name resolution of free variables occurs at runtime, not at compile time. This means that the following code will print 42::"
msgstr "حل نام متغیرهای آزاد در رانتایم رخ میدهد، نه در زمان کامپایل. این بدان معناست که کد زیر ۴۲ را چاپ خواهد کرد::"
msgid ""
"i = 10\n"
"def f():\n"
" print(i)\n"
"i = 42\n"
"f()"
msgstr ""
"i = 10\n"
"def f():\n"
" print(i)\n"
"i = 42\n"
"f()"
msgid "The :func:`eval` and :func:`exec` functions do not have access to the full environment for resolving names. Names may be resolved in the local and global namespaces of the caller. Free variables are not resolved in the nearest enclosing namespace, but in the global namespace. [#]_ The :func:`exec` and :func:`eval` functions have optional arguments to override the global and local namespace. If only one namespace is specified, it is used for both."
msgstr "توابع :func:`eval` و :func:`exec` برای حل نامها به محیط کامل دسترسی ندارند. نامها ممکن است در فضای نام محلی و سراسری فراخواننده حل شوند. متغیرهای آزاد در نزدیکترین فضای نام دربرگیرنده حل نمیشوند، بلکه در فضای نام سراسری حل میشوند. [#]_ توابع :func:`exec` و :func:`eval` آرگومانهای اختیاری برای جایگزینی فضای نام سراسری و محلی دارند. اگر تنها یک فضای نام مشخص شود، از آن برای هر دو استفاده میشود."
msgid "Exceptions"
msgstr "استثناها"
msgid "Exceptions are a means of breaking out of the normal flow of control of a code block in order to handle errors or other exceptional conditions. An exception is *raised* at the point where the error is detected; it may be *handled* by the surrounding code block or by any code block that directly or indirectly invoked the code block where the error occurred."
msgstr "استثناها راهی برای خارج شدن از جریان عادی کنترل یک بلوک کد، به منظور مدیریت خطاها یا دیگر شرایط استثنایی هستند. یک استثنا در نقطهای که خطا شناسایی میشود *پرتاب* میشود؛ ممکن است این استثنا توسط بلوک کد پیرامونی یا هر بلوک کدی که بهطور مستقیم یا غیرمستقیم بلوک کد محل وقوع خطا را فراخوانی کرده است، *مدیریت* شود."
msgid "The Python interpreter raises an exception when it detects a run-time error (such as division by zero). A Python program can also explicitly raise an exception with the :keyword:`raise` statement. Exception handlers are specified with the :keyword:`try` ... :keyword:`except` statement. The :keyword:`finally` clause of such a statement can be used to specify cleanup code which does not handle the exception, but is executed whether an exception occurred or not in the preceding code."
msgstr "مفسر پایتون هنگامی که یک خطای رانتایم (مانند تقسیم بر صفر) را تشخیص میدهد، استثنایی را پرتاب میکند. یک برنامه پایتون نیز میتواند بهصورت صریح استثنایی را با دستور :keyword:`raise` پرتاب کند. هندلرهای استثنا با دستور :keyword:`try` ... :keyword:`except` مشخص میشوند. از بند :keyword:`finally` چنین دستوری میتوان برای مشخص کردن کد پاکسازی استفاده کرد که به استثنا رسیدگی نمیکند، اما اجرا میشود، چه استثنایی در کد پیشین رخ داده باشد و چه رخ نداده باشد."
msgid "Python uses the \"termination\" model of error handling: an exception handler can find out what happened and continue execution at an outer level, but it cannot repair the cause of the error and retry the failing operation (except by re-entering the offending piece of code from the top)."
msgstr "پایتون از مدل «پایاندهی» (termination) برای مدیریت خطا استفاده میکند: یک هندلر استثنا میتواند دریابد چه اتفاقی رخ داده است و اجرا را در سطح بیرونی ادامه دهد، اما نمیتواند علت خطا را برطرف کند و عملیات ناموفق را دوباره اجرا کند (مگر با ورود دوباره به قطعهکد مشکلساز از ابتدا)."
msgid "When an exception is not handled at all, the interpreter terminates execution of the program, or returns to its interactive main loop. In either case, it prints a stack traceback, except when the exception is :exc:`SystemExit`."
msgstr "هنگامی که به یک استثنا به هیچ وجه رسیدگی نشود، مفسر اجرای برنامه را خاتمه میدهد، یا به حلقهی اصلی تعاملی خود بازمیگردد. در هر صورت، یک ردگیری پشته را چاپ میکند، مگر زمانی که استثنا :exc:`SystemExit` باشد."
msgid "Exceptions are identified by class instances. The :keyword:`except` clause is selected depending on the class of the instance: it must reference the class of the instance or a :term:`non-virtual base class <abstract base class>` thereof. The instance can be received by the handler and can carry additional information about the exceptional condition."
msgstr "استثناها با نمونههای کلاس شناسایی میشوند. بند :keyword:`except` بر اساس کلاس نمونه انتخاب میشود: این بند باید به کلاس نمونه یا به یک :term:`کلاس پایه غیرمجازی <abstract base class>` آن ارجاع دهد. نمونه میتواند توسط هندلر دریافت شود و میتواند حاوی اطلاعات بیشتری درباره وضعیت استثنایی باشد."
msgid "Exception messages are not part of the Python API. Their contents may change from one version of Python to the next without warning and should not be relied on by code which will run under multiple versions of the interpreter."
msgstr "پیامهای استثنا بخشی از API پایتون نیستند. محتوای آنها ممکن است از یک نسخه پایتون به نسخه بعدی بدون هشدار تغییر کند و کدی که تحت نسخههای متعددی از مفسر اجرا خواهد شد، نباید به آنها اتکا کند."
msgid "See also the description of the :keyword:`try` statement in section :ref:`try` and :keyword:`raise` statement in section :ref:`raise`."
msgstr "همچنین توضیح دستور :keyword:`try` را در بخش :ref:`try` و توضیح دستور :keyword:`raise` را در بخش :ref:`پرتاب <raise>` ببینید."
msgid "Runtime Components"
msgstr "کامپوننتهای رانتایم"
msgid "General Computing Model"
msgstr "مدل محاسباتی عمومی"
msgid "Python's execution model does not operate in a vacuum. It runs on a host machine and through that host's runtime environment, including its operating system (OS), if there is one. When a program runs, the conceptual layers of how it runs on the host look something like this:"
msgstr "مدل اجرای پایتون در خلأ عمل نمیکند. این مدل روی یک ماشین میزبان و از طریق محیط رانتایم آن میزبان، از جمله سیستمعامل آن (OS) در صورت وجود، اجرا میشود. هنگامی که یک برنامه اجرا میشود، لایههای مفهومی چگونگی اجرای آن روی میزبان چیزی شبیه به این هستند:"
msgid "**host machine**"
msgstr "ماشین میزبان"
msgid "**process** (global resources)"
msgstr "**فرایند** (منابع سراسری)"
msgid "**thread** (runs machine code)"
msgstr "**نخ** (کد ماشین را اجرا میکند)"
msgid "Each process represents a program running on the host. Think of each process itself as the data part of its program. Think of the process' threads as the execution part of the program. This distinction will be important to understand the conceptual Python runtime."
msgstr "هر فرایند نشاندهندهی برنامهای در حال اجرا روی میزبان است. خود هر فرایند را بهعنوان بخش دادهی برنامهی مربوط به آن در نظر بگیرید. نخهای فرایند را بهعنوان بخش اجرای برنامه در نظر بگیرید. این تمایز برای درک رانتایم مفهومی پایتون مهم خواهد بود."
msgid "The process, as the data part, is the execution context in which the program runs. It mostly consists of the set of resources assigned to the program by the host, including memory, signals, file handles, sockets, and environment variables."
msgstr "فرایند، بهعنوان بخش داده، زمینهی اجرایی است که برنامه در آن اجرا میشود. این زمینه عمدتاً از مجموعهای از منابعی تشکیل شده است که میزبان به برنامه اختصاص میدهد، از جمله حافظه، سیگنالها، دستههای پرونده، سوکتها و متغیرهای محیطی."
msgid "Processes are isolated and independent from one another. (The same is true for hosts.) The host manages the process' access to its assigned resources, in addition to coordinating between processes."
msgstr "فرایندها از یکدیگر جدا و مستقل هستند. (همین موضوع برای میزبانها نیز صادق است.) میزبان، علاوه بر هماهنگی میان فرایندها، دسترسی فرایند به منابع اختصاصیافتهی آن را مدیریت میکند."
msgid "Each thread represents the actual execution of the program's machine code, running relative to the resources assigned to the program's process. It's strictly up to the host how and when that execution takes place."
msgstr "هر نخ نشاندهنده اجرای واقعی کد ماشینی برنامه است که با توجه به منابع اختصاصیافته به فرایند برنامه اجرا میشود. اینکه آن اجرا چگونه و چه زمانی انجام شود، کاملاً به میزبان بستگی دارد."
msgid "From the point of view of Python, a program always starts with exactly one thread. However, the program may grow to run in multiple simultaneous threads. Not all hosts support multiple threads per process, but most do. Unlike processes, threads in a process are not isolated and independent from one another. Specifically, all threads in a process share all of the process' resources."
msgstr "از دیدگاه پایتون، یک برنامه همیشه دقیقاً با یک نخ آغاز میشود. با این حال، ممکن است برنامه گسترش یابد تا در چند نخ همزمان اجرا شود. همه میزبانها از چند نخ در هر فرایند پشتیبانی نمیکنند، اما بیشتر آنها پشتیبانی میکنند. برخلاف فرایندها، نخهای درون یک فرایند از یکدیگر جدا و مستقل نیستند. بهطور مشخص، تمام نخهای درون یک فرایند تمام منابع آن فرایند را به اشتراک میگذارند."
msgid "The fundamental point of threads is that each one does *run* independently, at the same time as the others. That may be only conceptually at the same time (\"concurrently\") or physically (\"in parallel\"). Either way, the threads effectively run at a non-synchronized rate."
msgstr "نکتهی اساسی دربارهی نخها این است که هر کدام بهطور مستقل *اجرا* میشود، همزمان با سایر نخها. این همزمانی ممکن است فقط بهصورت مفهومی («همزمان») یا بهصورت فیزیکی («موازی») باشد. در هر صورت، نخها در عمل با آهنگی غیرهمگام اجرا میشوند."
msgid "That non-synchronized rate means none of the process' memory is guaranteed to stay consistent for the code running in any given thread. Thus multi-threaded programs must take care to coordinate access to intentionally shared resources. Likewise, they must take care to be absolutely diligent about not accessing any *other* resources in multiple threads; otherwise two threads running at the same time might accidentally interfere with each other's use of some shared data. All this is true for both Python programs and the Python runtime."
msgstr "آن نرخ غیرهمگام به این معناست که هیچ تضمینی وجود ندارد که هیچ بخشی از حافظهی فرایند برای کدی که در هر نخ معینی اجرا میشود، سازگار باقی بماند. بنابراین برنامههای چندنخی باید برای هماهنگ کردن دسترسی به منابعی که عمداً به اشتراک گذاشته شدهاند، مراقب باشند. به همین ترتیب، آنها باید با نهایت دقت مراقب باشند که به هیچ منبع *دیگری* در چند نخ دسترسی پیدا نکنند؛ در غیر این صورت، ممکن است دو نخ که همزمان اجرا میشوند، بهطور تصادفی در استفادهی یکدیگر از برخی دادههای مشترک اختلال ایجاد کنند. همهی این موارد هم برای برنامههای پایتون و هم برای رانتایم پایتون صادق است."
msgid "The cost of this broad, unstructured requirement is the tradeoff for the kind of raw concurrency that threads provide. The alternative to the required discipline generally means dealing with non-deterministic bugs and data corruption."
msgstr "هزینهی این نیازمندی گسترده و بدون ساختار، معاوضهای است که برای گونهای از همروندی خام که نخها فراهم میکنند، پرداخت میشود. جایگزین انضباط مورد نیاز، معمولاً به معنای مواجهه با اشکالهای غیرقطعی و خرابی دادهها است."
msgid "Python Runtime Model"
msgstr "مدل رانتایم پایتون"
msgid "The same conceptual layers apply to each Python program, with some extra data layers specific to Python:"
msgstr "همان لایههای مفهومی برای هر برنامه پایتون صدق میکنند، با برخی لایههای داده اضافی مختص پایتون:"
msgid "Python global runtime (*state*)"
msgstr "رانتایم سراسری پایتون (*وضعیت*)"
msgid "Python interpreter (*state*)"
msgstr "مفسر پایتون (*وضعیت*)"
msgid "**thread** (runs Python bytecode and \"C-API\")"
msgstr "**نخ** (بایتکد پایتون و «C-API» را اجرا میکند)"
msgid "Python thread *state*"
msgstr "*وضعیت* نخ پایتون"
msgid "At the conceptual level: when a Python program starts, it looks exactly like that diagram, with one of each. The runtime may grow to include multiple interpreters, and each interpreter may grow to include multiple thread states."
msgstr "در سطح مفهومی: هنگامی که یک برنامه پایتون آغاز میشود، دقیقاً شبیه آن نمودار است، با یک نمونه از هر کدام. ممکن است رانتایم گسترش یابد تا شامل چندین مفسر شود و هر مفسر نیز ممکن است گسترش یابد تا شامل چندین وضعیت نخ شود."
msgid "A Python implementation won't necessarily implement the runtime layers distinctly or even concretely. The only exception is places where distinct layers are directly specified or exposed to users, like through the :mod:`threading` module."
msgstr "یک پیادهسازی پایتون لزوماً لایههای رانتایم را بهصورت متمایز یا حتی عینی پیادهسازی نمیکند. تنها استثنا جاهایی است که لایههای متمایز مستقیماً تعیین شدهاند یا در معرض کاربران قرار گرفتهاند، مانند آنچه از طریق ماژول :mod:`threading` انجام میشود."
msgid "The initial interpreter is typically called the \"main\" interpreter. Some Python implementations, like CPython, assign special roles to the main interpreter."
msgstr "مفسر اولیه معمولاً مفسر «main» نامیده میشود. برخی پیادهسازیهای پایتون، مانند CPython، نقشهای ویژهای به مفسر اصلی اختصاص میدهند."
msgid "Likewise, the host thread where the runtime was initialized is known as the \"main\" thread. It may be different from the process' initial thread, though they are often the same. In some cases \"main thread\" may be even more specific and refer to the initial thread state. A Python runtime might assign specific responsibilities to the main thread, such as handling signals."
msgstr "بههمین ترتیب، نخ میزبانی که رانتایم در آن مقداردهی اولیه شده است، بهعنوان نخ «اصلی» شناخته میشود. ممکن است این نخ با نخ اولیهی فرایند متفاوت باشد، اگرچه این دو اغلب یکسان هستند. در برخی موارد، «نخ اصلی» ممکن است حتی خاصتر باشد و به وضعیت اولیهی نخ اشاره کند. یک رانتایم پایتون ممکن است مسئولیتهای مشخصی را به نخ اصلی محول کند، مانند مدیریت سیگنالها."
msgid "As a whole, the Python runtime consists of the global runtime state, interpreters, and thread states. The runtime ensures all that state stays consistent over its lifetime, particularly when used with multiple host threads."
msgstr "در مجموع، رانتایم پایتون شامل وضعیت سراسری رانتایم، مفسرها و وضعیتهای نخ است. رانتایم تضمین میکند که تمام آن وضعیت در طول عمر خود سازگار باقی میماند، بهویژه زمانی که با چندین نخ میزبان استفاده میشود."
msgid "The global runtime, at the conceptual level, is just a set of interpreters. While those interpreters are otherwise isolated and independent from one another, they may share some data or other resources. The runtime is responsible for managing these global resources safely. The actual nature and management of these resources is implementation-specific. Ultimately, the external utility of the global runtime is limited to managing interpreters."
msgstr "رانتایم سراسری، در سطح مفهومی، تنها مجموعهای از مفسرها است. اگرچه این مفسرها در غیر این صورت از یکدیگر ایزوله و مستقل هستند، ممکن است برخی دادهها یا منابع دیگر را به اشتراک بگذارند. رانتایم مسئول مدیریت ایمن این منابع سراسری است. ماهیت و مدیریت واقعی این منابع وابسته به پیادهسازی است. در نهایت، کاربرد بیرونی رانتایم سراسری به مدیریت مفسرها محدود میشود."
msgid "In contrast, an \"interpreter\" is conceptually what we would normally think of as the (full-featured) \"Python runtime\". When machine code executing in a host thread interacts with the Python runtime, it calls into Python in the context of a specific interpreter."
msgstr "در مقابل، یک «مفسر» از نظر مفهومی همان چیزی است که معمولاً بهعنوان «رانتایم پایتون» (تمامامکانات) در نظر میگیریم. هنگامی که کد ماشینی در حال اجرا در یک نخ میزبان با رانتایم پایتون تعامل میکند، در زمینهی یک مفسر مشخص، پایتون را فراخوانی میکند."
msgid "The term \"interpreter\" here is not the same as the \"bytecode interpreter\", which is what regularly runs in threads, executing compiled Python code."
msgstr "اصطلاح «مفسر» در اینجا همان «مفسر بایتکد» نیست؛ چیزی که بهطور معمول در نخها اجرا میشود و کد پایتونِ کامپایلشده را اجرا میکند."
msgid "In an ideal world, \"Python runtime\" would refer to what we currently call \"interpreter\". However, it's been called \"interpreter\" at least since introduced in 1997 (`CPython:a027efa5b`_)."
msgstr "در یک دنیای ایدهآل، «رانتایم پایتون» به چیزی اشاره میکرد که امروزه آن را «مفسر» مینامیم. با این حال، حداقل از زمان معرفی آن در سال ۱۹۹۷، آن را «مفسر» نامیدهاند (`CPython:a027efa5b`_)."
msgid "Each interpreter completely encapsulates all of the non-process-global, non-thread-specific state needed for the Python runtime to work. Notably, the interpreter's state persists between uses. It includes fundamental data like :data:`sys.modules`. The runtime ensures multiple threads using the same interpreter will safely share it between them."
msgstr "هر مفسر بهطور کامل تمام وضعیت مورد نیاز برای کارکرد رانتایم پایتون را که نه سراسری در سطح فرایند است و نه مختص به نخ، در خود جای میدهد. بهویژه، وضعیت مفسر بین استفادهها باقی میماند. این وضعیت شامل دادههای بنیادینی مانند :data:`sys.modules` است. رانتایم تضمین میکند که چندین نخ که از یک مفسر استفاده میکنند، آن را بهصورت ایمن بین خود به اشتراک خواهند گذاشت."
msgid "A Python implementation may support using multiple interpreters at the same time in the same process. They are independent and isolated from one another. For example, each interpreter has its own :data:`sys.modules`."
msgstr "یک پیادهسازی پایتون ممکن است از استفادهی همزمان از چندین مفسر در یک فرایند پشتیبانی کند. آنها مستقل و از یکدیگر جدا هستند. برای مثال، هر مفسر :data:`sys.modules` خاص خود را دارد."
msgid "For thread-specific runtime state, each interpreter has a set of thread states, which it manages, in the same way the global runtime contains a set of interpreters. It can have thread states for as many host threads as it needs. It may even have multiple thread states for the same host thread, though that isn't as common."
msgstr "برای وضعیت رانتایم مخصوص نخ، هر مفسر مجموعهای از وضعیتهای نخ را دارد که آنها را مدیریت میکند، همانگونه که رانتایم سراسری شامل مجموعهای از مفسرها است. این میتواند برای هر تعداد نخ میزبانی که نیاز دارد، وضعیتهای نخ داشته باشد. حتی ممکن است چندین وضعیت نخ برای همان نخ میزبان داشته باشد، اگرچه این حالت چندان رایج نیست."
msgid "Each thread state, conceptually, has all the thread-specific runtime data an interpreter needs to operate in one host thread. The thread state includes the current raised exception and the thread's Python call stack. It may include other thread-specific resources."
msgstr "هر وضعیت نخ، از نظر مفهومی، دارای تمام دادههای رانتایم مختص نخ است که یک مفسر برای اجرا در یک نخ میزبان به آنها نیاز دارد. وضعیت نخ شامل استثنای پرتابشدهی جاری و پشتهی فراخوانی پایتون آن نخ است. ممکن است شامل سایر منابع مختص نخ نیز باشد."
msgid "The term \"Python thread\" can sometimes refer to a thread state, but normally it means a thread created using the :mod:`threading` module."
msgstr "اصطلاح «نخ پایتون» گاهی میتواند به وضعیت نخ اشاره کند، اما معمولاً به نخی گفته میشود که با استفاده از ماژول :mod:`threading` ایجاد شده است."
msgid "Each thread state, over its lifetime, is always tied to exactly one interpreter and exactly one host thread. It will only ever be used in that thread and with that interpreter."
msgstr "هر وضعیت نخ، در طول عمر خود، همیشه به دقیقاً یک مفسر و دقیقاً یک نخ میزبان وابسته است. این وضعیت فقط در همان نخ و با همان مفسر استفاده خواهد شد."
msgid "Multiple thread states may be tied to the same host thread, whether for different interpreters or even the same interpreter. However, for any given host thread, only one of the thread states tied to it can be used by the thread at a time."
msgstr "ممکن است چندین وضعیت نخ به یک نخ میزبان واحد متصل باشند، خواه برای مفسرهای مختلف، خواه حتی برای همان مفسر. با این حال، برای هر نخ میزبان معین، در هر زمان تنها یکی از وضعیتهای نخ متصل به آن میتواند توسط آن نخ استفاده شود."
msgid "Thread states are isolated and independent from one another and don't share any data, except for possibly sharing an interpreter and objects or other resources belonging to that interpreter."
msgstr "وضعیتهای نخ از یکدیگر جدا و مستقل هستند و هیچ دادهای را به اشتراک نمیگذارند، مگر در مواردی که ممکن است یک مفسر و اشیاء یا سایر منابع متعلق به آن مفسر به اشتراک گذاشته شوند."
msgid "Once a program is running, new Python threads can be created using the :mod:`threading` module (on platforms and Python implementations that support threads). Additional processes can be created using the :mod:`os`, :mod:`subprocess`, and :mod:`multiprocessing` modules. Interpreters can be created and used with the :mod:`~concurrent.interpreters` module. Coroutines (async) can be run using :mod:`asyncio` in each interpreter, typically only in a single thread (often the main thread)."
msgstr "هنگامی که برنامهای در حال اجرا است، میتوان نخهای جدید پایتون را با استفاده از ماژول :mod:`threading` ایجاد کرد (در پلتفرمها و پیادهسازیهای پایتون که از نخها پشتیبانی میکنند). میتوان فرآیندهای اضافی را با استفاده از ماژولهای :mod:`os`، :mod:`subprocess` و :mod:`multiprocessing` ایجاد کرد. میتوان مفسرها را با استفاده از ماژول :mod:`~concurrent.interpreters` ایجاد کرد و به کار برد. میتوان همروالها (ناهمگام) را با استفاده از :mod:`asyncio` در هر مفسر اجرا کرد، معمولاً فقط در یک نخ (اغلب نخ اصلی)."
msgid "Footnotes"
msgstr "پانویسها"
msgid "This limitation occurs because the code that is executed by these operations is not available at the time the module is compiled."
msgstr "این محدودیت به این دلیل رخ میدهد که کدی که توسط این عملیات اجرا میشود، در زمان کامپایل ماژول در دسترس نیست."
msgid "execution model"
msgstr "مدل اجرا"
msgid "code"
msgstr "کد"
msgid "block"
msgstr "بلوک"
msgid "execution"
msgstr "اجرا"
msgid "frame"
msgstr "فریم"
msgid "namespace"
msgstr "فضای نام"
msgid "scope"
msgstr "محدوده"
msgid "name"
msgstr "نام"
msgid "binding"
msgstr "پیوند"
msgid "from"
msgstr "از"
msgid "import statement"
msgstr "دستور ایمپورت"
msgid "free"
msgstr "آزاد"
msgid "variable"
msgstr "متغیر"
msgid "environment"
msgstr "محیط"
msgid "NameError (built-in exception)"
msgstr "NameError (استثنای توکار)"
msgid "UnboundLocalError"
msgstr "UnboundLocalError"
msgid "module"
msgstr "ماژول"
msgid "__main__"
msgstr "__main__"
msgid "restricted"
msgstr "محدود"
msgid "exception"
msgstr "استثنا"
msgid "raise an exception"
msgstr "پرتاب یک استثنا"
msgid "handle an exception"
msgstr "مدیریت یک استثنا"
msgid "exception handler"
msgstr "هندلر استثنا"
msgid "errors"
msgstr "خطاها"
msgid "error handling"
msgstr "مدیریت خطا"
msgid "termination model"
msgstr "مدل خاتمه"
msgid "SystemExit (built-in exception)"
msgstr "SystemExit (استثنای توکار)"

