Repository navigation
Expand file tree
/
Copy pathconcurrent.interpreters.po
More file actions
345 lines (258 loc) · 26.6 KB
/
Copy pathconcurrent.interpreters.po
File metadata and controls
345 lines (258 loc) · 26.6 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
# Persian translations for Python package.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# Automatically generated, 2026.
#
# Translators:
# 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-07-25 12:59+0330\n"
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
"Language-Team: none\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid ":mod:`!concurrent.interpreters` --- Multiple interpreters in the same process"
msgstr ":mod:`!concurrent.interpreters` --- چندین مفسر در یک فرایند واحد"
msgid "**Source code:** :source:`Lib/concurrent/interpreters`"
msgstr "**کد منبع:** :source:`Lib/concurrent/interpreters`"
msgid "The :mod:`!concurrent.interpreters` module constructs higher-level interfaces on top of the lower level :mod:`!_interpreters` module."
msgstr "ماژول :mod:`!concurrent.interpreters` رابطهای سطح بالاتر را بر فراز ماژول سطح پایینتر :mod:`!_interpreters` ایجاد میکند."
msgid "The module is primarily meant to provide a basic API for managing interpreters (AKA \"subinterpreters\") and running things in them. Running mostly involves switching to an interpreter (in the current thread) and calling a function in that execution context."
msgstr "این ماژول عمدتاً برای ارائه یک API پایه برای مدیریت مفسرها (معروف به «subinterpreters») و اجرای موارد در آنها در نظر گرفته شده است. اجرا عمدتاً شامل انتقال به یک مفسر (در نخ جاری) و فراخوانی یک تابع در آن زمینه اجرا است."
msgid "For concurrency, interpreters themselves (and this module) don't provide much more than isolation, which on its own isn't useful. Actual concurrency is available separately through :mod:`threads <threading>` -- see `below <interp-concurrency_>`_."
msgstr "برای همروندی، خود مفسرها (و این ماژول) چیز چندانی بیشتر از جداسازی فراهم نمیکنند، که بهتنهایی مفید نیست. همروندی واقعی بهصورت جداگانه از طریق :mod:`نخها <threading>` در دسترس است -- `پایین <interp-concurrency_>`_ را ببینید."
msgid ":class:`~concurrent.futures.InterpreterPoolExecutor`"
msgstr ":class:`~concurrent.futures.InterpreterPoolExecutor`"
msgid "Combines threads with interpreters in a familiar interface."
msgstr "نخها را با مفسرها در یک رابط آشنا ترکیب میکند."
msgid ":ref:`isolating-extensions-howto`"
msgstr ":ref:`isolating-extensions-howto`"
msgid "How to update an extension module to support multiple interpreters."
msgstr "چگونگی بهروزرسانی یک ماژول توسعه برای پشتیبانی از چندین مفسر."
msgid ":pep:`554`"
msgstr ":pep:`554`"
msgid ":pep:`734`"
msgstr ":pep:`734`"
msgid ":pep:`684`"
msgstr ":pep:`684`"
msgid "Availability"
msgstr "دسترسپذیری"
msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information."
msgstr "این ماژول روی WebAssembly کار نمیکند یا در دسترس نیست. برای اطلاعات بیشتر :ref:`wasm-availability` را ببینید."
msgid "Key details"
msgstr "جزئیات کلیدی"
msgid "Before we dive in further, there are a small number of details to keep in mind about using multiple interpreters:"
msgstr "پیش از آنکه بیشتر وارد بحث شویم، تعداد اندکی جزئیات وجود دارد که باید دربارهی استفاده از چندین مفسر در نظر داشته باشید:"
msgid "`isolated <interp-isolation_>`_, by default"
msgstr "`ایزوله <interp-isolation_>`_، بهطور پیشفرض"
msgid "no implicit threads"
msgstr "بدون نخهای ضمنی"
msgid "not all PyPI packages support use in multiple interpreters yet"
msgstr "هنوز همهی بستههای PyPI از استفاده در چندین مفسر پشتیبانی نمیکنند"
msgid "Introduction"
msgstr "مقدمه"
msgid "An \"interpreter\" is effectively the execution context of the Python runtime. It contains all of the state the runtime needs to execute a program. This includes things like the import state and builtins. (Each thread, even if there's only the main thread, has some extra runtime state, in addition to the current interpreter, related to the current exception and the bytecode eval loop.)"
msgstr "یک «مفسر» عملاً زمینه اجرای رانتایم پایتون است. این شامل تمام وضعیت مورد نیاز رانتایم برای اجرای یک برنامه است. این شامل مواردی مانند وضعیت ایمپورت و توکارها میشود. (هر نخ، حتی اگر فقط نخ اصلی وجود داشته باشد، علاوه بر مفسر فعلی، دارای وضعیت اضافی رانتایم مربوط به استثنای فعلی و حلقه ارزیابی بایتکد است.)"
msgid "The concept and functionality of the interpreter have been a part of Python since version 2.2, but the feature was only available through the C-API and not well known, and the `isolation <interp-isolation_>`_ was relatively incomplete until version 3.12."
msgstr "مفهوم و کارکرد مفسر از نسخهی 2.2 بخشی از پایتون بوده است، اما این قابلیت تنها از طریق C-API در دسترس بود و چندان شناختهشده نبود، و `جداسازی <interp-isolation_>`_ تا نسخهی 3.12 نسبتاً ناقص بود."
msgid "Multiple Interpreters and Isolation"
msgstr "مفسرهای متعدد و جداسازی"
msgid "A Python implementation may support using multiple interpreters in the same process. CPython has this support. Each interpreter is effectively isolated from the others (with a limited number of carefully managed process-global exceptions to the rule)."
msgstr "یک پیادهسازی پایتون ممکن است از استفاده از چندین مفسر در یک فرایند پشتیبانی کند. CPython این پشتیبانی را دارد. هر مفسر عملاً از سایر مفسرها ایزوله است (با تعداد محدودی استثنا بر این قاعده، که سراسری در سطح فرایند هستند و بهدقت مدیریت میشوند)."
msgid "That isolation is primarily useful as a strong separation between distinct logical components of a program, where you want to have careful control of how those components interact."
msgstr "آن جداسازی عمدتاً بهعنوان یک تفکیک قوی میان کامپوننتهای منطقی مجزای یک برنامه مفید است، جایی که میخواهید کنترل دقیقی بر نحوه تعامل آن کامپوننتها داشته باشید."
msgid "Interpreters in the same process can technically never be strictly isolated from one another since there are few restrictions on memory access within the same process. The Python runtime makes a best effort at isolation but extension modules may easily violate that. Therefore, do not use multiple interpreters in security-sensitive situations, where they shouldn't have access to each other's data."
msgstr "مفسرهای موجود در یک فرایند یکسان، از نظر فنی هرگز نمیتوانند بهطور کامل از یکدیگر جدا شوند، زیرا محدودیتهای اندکی برای دسترسی به حافظه در همان فرایند وجود دارد. رانتایم پایتون نهایت تلاش خود را برای جداسازی به کار میگیرد، اما ماژولهای توسعه ممکن است بهراحتی آن را نقض کنند. بنابراین، در موقعیتهای حساس امنیتی، جایی که نباید به دادههای یکدیگر دسترسی داشته باشند، از چندین مفسر استفاده نکنید."
msgid "Running in an Interpreter"
msgstr "اجرا در مفسر"
msgid "Running in a different interpreter involves switching to it in the current thread and then calling some function. The runtime will execute the function using the current interpreter's state. The :mod:`!concurrent.interpreters` module provides a basic API for creating and managing interpreters, as well as the switch-and-call operation."
msgstr "اجرا در یک مفسر دیگر، مستلزم تعویض به آن در نخ جاری و سپس فراخوانی یک تابع است. رانتایم تابع را با استفاده از وضعیت مفسر جاری اجرا میکند. ماژول :mod:`!concurrent.interpreters` یک API پایه برای ایجاد و مدیریت مفسرها و همچنین عملیات تعویض و فراخوانی (switch-and-call) ارائه میکند."
msgid "No other threads are automatically started for the operation. There is `a helper <interp-call-in-thread_>`_ for that though. There is another dedicated helper for calling the builtin :func:`exec` in an interpreter."
msgstr "هیچ نخ دیگری بهطور خودکار برای این عملیات آغاز نمیشود. با این حال، برای این کار `یک تابع کمکی <interp-call-in-thread_>`_ وجود دارد. یک تابع کمکی اختصاصی دیگر برای فراخوانی :func:`exec` توکار در یک مفسر وجود دارد."
msgid "When :func:`exec` (or :func:`eval`) are called in an interpreter, they run using the interpreter's :mod:`!__main__` module as the \"globals\" namespace. The same is true for functions that aren't associated with any module. This is the same as how scripts invoked from the command-line run in the :mod:`!__main__` module."
msgstr "هنگامی که :func:`exec` (یا :func:`eval`) در یک مفسر فراخوانی میشوند، با استفاده از ماژول :mod:`!__main__` مفسر بهعنوان فضای نام «globals» اجرا میشوند. همین موضوع برای توابعی که با هیچ ماژولی مرتبط نیستند نیز صادق است. این مشابه روشی است که اسکریپتهای فراخوانیشده از خط فرمان در ماژول :mod:`!__main__` اجرا میشوند."
msgid "Concurrency and Parallelism"
msgstr "همروندی و موازیسازی"
msgid "As noted earlier, interpreters do not provide any concurrency on their own. They strictly represent the isolated execution context the runtime will use *in the current thread*. That isolation makes them similar to processes, but they still enjoy in-process efficiency, like threads."
msgstr "همانطور که پیشتر گفته شد، مفسرها بهخودی خود هیچگونه همروندیای فراهم نمیکنند. آنها صرفاً نمایانگر زمینه اجرای جداشدهای هستند که رانتایم *در نخ جاری* از آن استفاده خواهد کرد. این جداسازی آنها را شبیه به فرآیندها میکند، اما همچنان مانند نخها از کارایی درونفرآیندی برخوردارند."
msgid "All that said, interpreters do naturally support certain flavors of concurrency. There's a powerful side effect of that isolation. It enables a different approach to concurrency than you can take with async or threads. It's a similar concurrency model to CSP or the actor model, a model which is relatively easy to reason about."
msgstr "با همه این اوصاف، مفسرها بهطور طبیعی از برخی سبکهای همروندی پشتیبانی میکنند. آن جداسازی اثر جانبی قدرتمندی دارد. این امر رویکرد متفاوتی به همروندی را ممکن میسازد، نسبت به آنچه میتوانید با ناهمگام یا نخها در پیش بگیرید. این مدل همروندی مشابه CSP یا مدل کنشگر (actor model) است؛ مدلی که استدلال درباره آن نسبتاً آسان است."
msgid "You can take advantage of that concurrency model in a single thread, switching back and forth between interpreters, Stackless-style. However, this model is more useful when you combine interpreters with multiple threads. This mostly involves starting a new thread, where you switch to another interpreter and run what you want there."
msgstr "شما میتوانید از آن مدل همروندی در یک نخ واحد بهره ببرید و به سبک Stackless، بهصورت رفتوبرگشتی بین مفسرها جابهجا شوید. با این حال، این مدل زمانی مفیدتر است که مفسرها را با چندین نخ ترکیب کنید. این کار عمدتاً شامل شروع یک نخ جدید است، که در آن به مفسر دیگری جابهجا میشوید و آنچه را میخواهید در آنجا اجرا میکنید."
msgid "Each actual thread in Python, even if you're only running in the main thread, has its own *current* execution context. Multiple threads can use the same interpreter or different ones."
msgstr "هر نخ واقعی در پایتون، حتی اگر فقط در نخ اصلی در حال اجرا باشید، زمینهی اجرای *فعلی* خود را دارد. چندین نخ میتوانند از یک مفسر مشترک یا مفسرهای متفاوت استفاده کنند."
msgid "At a high level, you can think of the combination of threads and interpreters as threads with opt-in sharing."
msgstr "در سطح بالا، میتوانید ترکیب نخها و مفسرها را بهعنوان نخهایی با اشتراکگذاری انتخابی در نظر بگیرید."
msgid "As a significant bonus, interpreters are sufficiently isolated that they do not share the :term:`GIL`, which means combining threads with multiple interpreters enables full multi-core parallelism. (This has been the case since Python 3.12.)"
msgstr "بهعنوان یک مزیت قابلتوجه، مفسرها بهاندازهای از یکدیگر ایزوله هستند که :term:`GIL` را به اشتراک نمیگذارند؛ این بدان معناست که ترکیب نخها با چندین مفسر، موازیسازی کامل چندهستهای را ممکن میسازد. (این حالت از پایتون 3.12 برقرار بوده است.)"
msgid "Communication Between Interpreters"
msgstr "ارتباط میان مفسرها"
msgid "In practice, multiple interpreters are useful only if we have a way to communicate between them. This usually involves some form of message passing, but can even mean sharing data in some carefully managed way."
msgstr "در عمل، چندین مفسر تنها زمانی مفید هستند که راهی برای برقراری ارتباط بین آنها داشته باشیم. این موضوع معمولاً شامل نوعی پیامرسانی میشود، اما حتی میتواند به معنای اشتراکگذاری دادهها به شیوهای با مدیریت دقیق باشد."
msgid "With this in mind, the :mod:`!concurrent.interpreters` module provides a :class:`queue.Queue` implementation, available through :func:`create_queue`."
msgstr "با در نظر گرفتن این موضوع، ماژول :mod:`!concurrent.interpreters` یک پیادهسازی از :class:`queue.Queue` را ارائه میدهد که از طریق :func:`create_queue` در دسترس است."
msgid "\"Sharing\" Objects"
msgstr "«اشتراکگذاری» اشیاء"
msgid "Any data actually shared between interpreters loses the thread-safety provided by the :term:`GIL`. There are various options for dealing with this in extension modules. However, from Python code the lack of thread-safety means objects can't actually be shared, with a few exceptions. Instead, a copy must be created, which means mutable objects won't stay in sync."
msgstr "هر دادهای که واقعاً بین مفسرها به اشتراک گذاشته میشود، ایمنی نخی فراهمشده از سوی :term:`GIL` را از دست میدهد. گزینههای مختلفی برای مدیریت این موضوع در ماژولهای توسعه وجود دارد. با این حال، از دید کد پایتون، فقدان ایمنی نخی به این معناست که اشیاء، بهجز چند استثنا، عملاً نمیتوانند به اشتراک گذاشته شوند. در عوض، باید یک رونوشت ایجاد شود، که به این معناست که اشیاء تغییرپذیر همگام باقی نخواهند ماند."
msgid "By default, most objects are copied with :mod:`pickle` when they are passed to another interpreter. Nearly all of the immutable builtin objects are either directly shared or copied efficiently. For example:"
msgstr "بهطور پیشفرض، بیشتر اشیاء هنگامی که به مفسر دیگری منتقل میشوند، با :mod:`pickle` کپی میشوند. تقریباً همهی اشیاء تغییرناپذیر توکار یا مستقیماً به اشتراک گذاشته میشوند یا بهصورت کارآمد کپی میشوند. برای مثال:"
msgid ":const:`None`"
msgstr ":const:`None`"
msgid ":class:`bool` (:const:`True` and :const:`False`)"
msgstr ":class:`bool` (:const:`True` و :const:`False`)"
msgid ":class:`bytes`"
msgstr ":class:`bytes`"
msgid ":class:`str`"
msgstr ":class:`str`"
msgid ":class:`int`"
msgstr ":class:`int`"
msgid ":class:`float`"
msgstr ":class:`float`"
msgid ":class:`tuple` (of similarly supported objects)"
msgstr ":class:`tuple` (از اشیاء پشتیبانیشدهی مشابه)"
msgid "There are a small number of Python types that actually share mutable data between interpreters:"
msgstr "تعداد کمی از نوعهای پایتون وجود دارد که واقعاً دادههای تغییرپذیر را بین مفسرها به اشتراک میگذارند:"
msgid ":class:`memoryview`"
msgstr ":class:`memoryview`"
msgid ":class:`Queue`"
msgstr ":class:`Queue`"
msgid "Reference"
msgstr "مرجع"
msgid "This module defines the following functions:"
msgstr "این ماژول توابع زیر را تعریف میکند:"
msgid "Return a :class:`list` of :class:`Interpreter` objects, one for each existing interpreter."
msgstr "یک :class:`list` از اشیاء :class:`Interpreter` برمیگرداند، یکی برای هر مفسر موجود."
msgid "Return an :class:`Interpreter` object for the currently running interpreter."
msgstr "یک شیء :class:`Interpreter` برای مفسر در حال اجرا برمیگرداند."
msgid "Return an :class:`Interpreter` object for the main interpreter. This is the interpreter the runtime created to run the :term:`REPL` or the script given at the command-line. It is usually the only one."
msgstr "یک شیء :class:`Interpreter` برای مفسر اصلی بازمیگرداند. این همان مفسری است که رانتایم برای اجرای :term:`REPL` یا اسکریپت دادهشده در خط فرمان ایجاد کرده است. معمولاً تنها مفسر همین است."
msgid "Initialize a new (idle) Python interpreter and return a :class:`Interpreter` object for it."
msgstr "یک مفسر پایتون جدید (بیکار) را راهاندازی میکند و یک شیء :class:`Interpreter` برای آن برمیگرداند."
msgid "Initialize a new cross-interpreter queue and return a :class:`Queue` object for it."
msgstr "یک صف بینمفسری جدید را مقداردهی اولیه میکند و یک شیء :class:`Queue` برای آن برمیگرداند."
msgid "Interpreter objects"
msgstr "اشیای مفسر"
msgid "A single interpreter in the current process."
msgstr "یک مفسر واحد در فرایند جاری."
msgid "Generally, :class:`Interpreter` shouldn't be called directly. Instead, use :func:`create` or one of the other module functions."
msgstr "بهطور کلی، :class:`Interpreter` نباید مستقیماً فراخوانی شود. در عوض، از :func:`create` یا یکی دیگر از توابع ماژول استفاده کنید."
msgid "(read-only)"
msgstr "(فقطخواندنی)"
msgid "The underlying interpreter's ID."
msgstr "شناسهی مفسر زیربنایی."
msgid "A string describing where the interpreter came from."
msgstr "رشتهای که منشأ مفسر را توصیف میکند."
msgid "Return ``True`` if the interpreter is currently executing code in its :mod:`!__main__` module and ``False`` otherwise."
msgstr "اگر مفسر هماکنون در حال اجرای کد در ماژول :mod:`!__main__` خود باشد، ``True`` و در غیر این صورت ``False`` برمیگرداند."
msgid "Finalize and destroy the interpreter."
msgstr "نهاییسازی و نابود کردن مفسر."
msgid "Bind objects in the interpreter's :mod:`!__main__` module."
msgstr "اشیاء را در ماژول :mod:`!__main__` مفسر مقید کنید."
msgid "Some objects are actually shared and some are copied efficiently, but most are copied via :mod:`pickle`. See :ref:`interp-object-sharing`."
msgstr "برخی از شیءها در واقع به اشتراک گذاشته میشوند و برخی بهصورت کارآمد کپی میشوند، اما بیشتر آنها از طریق :mod:`pickle` کپی میشوند. :ref:`interp-object-sharing` را ببینید."
msgid "Run the given source code in the interpreter (in the current thread)."
msgstr "کد منبع دادهشده را در مفسر (در نخ فعلی) اجرا کنید."
msgid "Return the result of running the given function in the interpreter (in the current thread)."
msgstr "نتیجهی اجرای تابع دادهشده در مفسر (در نخ فعلی) را برگردانید."
msgid "Run the given function in the interpreter (in a new thread)."
msgstr "تابع دادهشده را در مفسر اجرا کنید (در یک نخ جدید)."
msgid "Exceptions"
msgstr "استثناها"
msgid "This exception, a subclass of :exc:`Exception`, is raised when an interpreter-related error happens."
msgstr "این استثنا، زیرکلاسی از :exc:`Exception`، زمانی پرتاب میشود که خطای مرتبط با مفسر رخ دهد."
msgid "This exception, a subclass of :exc:`InterpreterError`, is raised when the targeted interpreter no longer exists."
msgstr "این استثنا، زیرکلاسی از :exc:`InterpreterError`، زمانی پرتاب میشود که مفسر هدف دیگر وجود ندارد."
msgid "This exception, a subclass of :exc:`InterpreterError`, is raised when the running code raised an uncaught exception."
msgstr "این استثنا، که زیرکلاسی از :exc:`InterpreterError` است، زمانی پرتاب میشود که کد در حال اجرا، استثنای گرفتهنشدهای را پرتاب کرده باشد."
msgid "A basic snapshot of the exception raised in the other interpreter."
msgstr "یک تصویر لحظهای ساده از استثنای پرتابشده در مفسر دیگر."
msgid "This exception, a subclass of :exc:`TypeError`, is raised when an object cannot be sent to another interpreter."
msgstr "این استثنا، که زیرکلاسی از :exc:`TypeError` است، زمانی پرتاب میشود که نتوان یک شیء را به مفسر دیگری ارسال کرد."
msgid "Communicating Between Interpreters"
msgstr "ارتباط بین مفسرها"
msgid "A wrapper around a low-level, cross-interpreter queue, which implements the :class:`queue.Queue` interface. The underlying queue can only be created through :func:`create_queue`."
msgstr "پوششی برای یک صف بینمفسری سطح پایین، که رابط :class:`queue.Queue` را پیادهسازی میکند. صف زیرین فقط از طریق :func:`create_queue` قابل ایجاد است."
msgid "The queue's ID."
msgstr "شناسهی صف."
msgid "This exception, a subclass of :exc:`queue.Empty`, is raised from :meth:`!Queue.get` and :meth:`!Queue.get_nowait` when the queue is empty."
msgstr "این استثنا، زیرکلاسی از :exc:`queue.Empty`، زمانی از :meth:`!Queue.get` و :meth:`!Queue.get_nowait` پرتاب میشود که صف خالی باشد."
msgid "This exception, a subclass of :exc:`queue.Full`, is raised from :meth:`!Queue.put` and :meth:`!Queue.put_nowait` when the queue is full."
msgstr "این استثنا، زیرکلاسی از :exc:`queue.Full`، هنگامی از :meth:`!Queue.put` و :meth:`!Queue.put_nowait` پرتاب میشود که صف پر باشد."
msgid "Basic usage"
msgstr "استفادهی پایه"
msgid "Creating an interpreter and running code in it::"
msgstr "ایجاد یک مفسر و اجرای کد در آن::"
msgid ""
"from concurrent import interpreters\n"
"\n"
"interp = interpreters.create()\n"
"\n"
"# Run in the current OS thread.\n"
"\n"
"interp.exec('print(\"spam!\")')\n"
"\n"
"interp.exec(\"\"\"if True:\n"
" print('spam!')\n"
" \"\"\")\n"
"\n"
"from textwrap import dedent\n"
"interp.exec(dedent(\"\"\"\n"
" print('spam!')\n"
" \"\"\"))\n"
"\n"
"def run(arg):\n"
" return arg\n"
"\n"
"res = interp.call(run, 'spam!')\n"
"print(res)\n"
"\n"
"def run():\n"
" print('spam!')\n"
"\n"
"interp.call(run)\n"
"\n"
"# Run in new OS thread.\n"
"\n"
"t = interp.call_in_thread(run)\n"
"t.join()"
msgstr ""
"from concurrent import interpreters\n"
"\n"
"interp = interpreters.create()\n"
"\n"
"# Run in the current OS thread.\n"
"\n"
"interp.exec('print(\"spam!\")')\n"
"\n"
"interp.exec(\"\"\"if True:\n"
" print('spam!')\n"
" \"\"\")\n"
"\n"
"from textwrap import dedent\n"
"interp.exec(dedent(\"\"\"\n"
" print('spam!')\n"
" \"\"\"))\n"
"\n"
"def run(arg):\n"
" return arg\n"
"\n"
"res = interp.call(run, 'spam!')\n"
"print(res)\n"
"\n"
"def run():\n"
" print('spam!')\n"
"\n"
"interp.call(run)\n"
"\n"
"# Run in new OS thread.\n"
"\n"
"t = interp.call_in_thread(run)\n"
"t.join()"