changeset 270:2cb6e2824776

Support indexed assignment of pyobjects into builtin array types * @pyobject/subsasgn.m: If the object being indexed is not a pyobject, pass arguments along to the builtin subsasgn.
author Mike Miller <mtmiller@octave.org>
date Fri, 29 Jul 2016 13:09:47 -0700
parents 8c543a859ba2
children 1446812ec1de
files @pyobject/subsasgn.m
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/@pyobject/subsasgn.m	Fri Jul 29 13:03:29 2016 -0700
+++ b/@pyobject/subsasgn.m	Fri Jul 29 13:09:47 2016 -0700
@@ -30,6 +30,16 @@
 
 function r = subsasgn(x, idx, rhs)
 
+  if (nargin != 3)
+    print_usage ();
+  endif
+
+  ## If rhs is a pyobject but x is not, dispatch to the builtin subsasgn
+  if (! isa (x, "pyobject"))
+    r = builtin ("subsasgn", x, idx, rhs);
+    return;
+  endif
+
   switch idx.type
     case "."
       assert (ischar (idx.subs))