[IPython-dev] Environment in load balanced map_async?

Doug Blank doug.blank at gmail.com
Fri Sep 12 17:17:06 EDT 2014


Can you imagine why this would fail:

view_load_balanced.map_async(
            lambda arg: kernels.do_function_direct(arg),
            [1, 2, 3])

but that this ugly, terrible hack would work:

view.execute("""
import os
os.kernels = kernels
""")
view_load_balanced.map_async(
            lambda arg: os.kernels.do_function_direct(arg),
            [1, 2, 3])

Why would I not be able to find a variable in the environment, but I can
put it in a module, and find it there?

-Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140912/25275461/attachment.html>


More information about the IPython-dev mailing list