@@ -243,6 +243,16 @@ Interpreter objects
243
243
Generally, :class: `Interpreter ` shouldn't be called directly.
244
244
Instead, use :func: `create ` or one of the other module functions.
245
245
246
+ In addition to interpreters created by this module (via
247
+ :func: `create `), an :class: `!Interpreter ` object may wrap
248
+ interpreters not created by the module. Some methods fail for such
249
+ interpreters, as noted below for each such method.
250
+
251
+ An interpreter may be marked as currently executing code in its
252
+ :mod: `!__main__ ` module. See :meth: `~Interpreter.is_running `.
253
+ Some methods of a running :class: `!interpreter ` fail, as noted
254
+ below for each such method.
255
+
246
256
.. attribute :: id
247
257
248
258
(read-only)
@@ -271,21 +281,33 @@ Interpreter objects
271
281
Some objects are actually shared and some are copied efficiently,
272
282
but most are copied via :mod: `pickle `. See :ref: `interp-object-sharing `.
273
283
284
+ This method fails for unsupported modules.
285
+ It also fails for running modules.
286
+
274
287
.. method :: exec(code, /, dedent=True)
275
288
276
289
Run the given source code in the interpreter (in the current thread).
277
290
291
+ This method fails for unsupported modules.
292
+ It also fails for running modules.
293
+
278
294
.. method :: call(callable, /, *args, **kwargs)
279
295
280
296
Return the result of calling running the given function in the
281
297
interpreter (in the current thread).
282
298
299
+ This method fails for unsupported modules.
300
+ It also fails for running modules.
301
+
283
302
.. _interp-call-in-thread :
284
303
285
304
.. method :: call_in_thread(callable, /, *args, **kwargs)
286
305
287
306
Run the given function in the interpreter (in a new thread).
288
307
308
+ This method fails for unsupported modules.
309
+ It also fails for running modules.
310
+
289
311
Exceptions
290
312
^^^^^^^^^^
291
313
0 commit comments