diff @pyobject/pyobject.m @ 217:69abda471c67

Attempt at moving pyobject from octave to python * @pyobject/pyobject.m: keep ref to __InOct__ in __main__ * pyeval: keep ref to __InOct__ in __main__ * @pyobject/dummy.m: add pycall doctest * octave_to_python.cc: if we see pyobject, get original from __InOct__
author Colin Macdonald <cbm@m.fsf.org>
date Sat, 28 May 2016 10:18:39 -0700
parents 3b2b7db7d709
children 02da92723889
line wrap: on
line diff
--- a/@pyobject/pyobject.m	Fri May 27 14:13:34 2016 -0700
+++ b/@pyobject/pyobject.m	Sat May 28 10:18:39 2016 -0700
@@ -42,7 +42,10 @@
       end
       cmd = sprintf ([ ...
         'if not ("__InOct__" in vars() or "__InOct__" in globals()):\n' ...
-        '  __InOct__ = dict()\n' ...
+        '    __InOct__ = dict()\n' ...
+        '    # FIXME: make it accessible elsewhere?\n' ...
+        '    import __main__\n' ...
+        '    __main__.__InOct__ = __InOct__\n' ...
         '__InOct__[hex(id(%s))] = %s' ], ...
         pyvarname, pyvarname);
       pyexec (cmd);