MCPcopy Index your code
hub / github.com/python/cpython / prepare_main

Method prepare_main

Lib/concurrent/interpreters/__init__.py:189–195  ·  view source on GitHub ↗

Bind the given values into the interpreter's __main__. The values must be shareable.

(self, ns=None, /, **kwargs)

Source from the content-addressed store, hash-verified

187 return _interpreters.destroy(self._id, restrict=True)
188
189 def prepare_main(self, ns=None, /, **kwargs):
190 """Bind the given values into the interpreter's __main__.
191
192 The values must be shareable.
193 """
194 ns = dict(ns, **kwargs) if ns is not None else kwargs
195 _interpreters.set___main___attrs(self._id, ns, restrict=True)
196
197 def exec(self, code, /):
198 """Run the given source code in the interpreter.

Callers 14

test_shareableMethod · 0.80
_run_outputFunction · 0.80
test_emptyMethod · 0.80
test_dictMethod · 0.80
test_tupleMethod · 0.80
test_kwargsMethod · 0.80
test_dict_and_kwargsMethod · 0.80
test_not_shareableMethod · 0.80
test_runningMethod · 0.80

Calls

no outgoing calls

Tested by 13

test_shareableMethod · 0.64
test_emptyMethod · 0.64
test_dictMethod · 0.64
test_tupleMethod · 0.64
test_kwargsMethod · 0.64
test_dict_and_kwargsMethod · 0.64
test_not_shareableMethod · 0.64
test_runningMethod · 0.64