changeset 299:714d1bf1ef78

Add test of multivariable output from subsref * @pyobject/subsref.m: Add test.
author Colin Macdonald <cbm@m.fsf.org>
date Wed, 03 Aug 2016 20:26:57 -0700
parents df1bddece9d5
children 6a28a5a62206
files @pyobject/subsref.m
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/@pyobject/subsref.m	Wed Aug 03 20:33:33 2016 -0700
+++ b/@pyobject/subsref.m	Wed Aug 03 20:26:57 2016 -0700
@@ -138,6 +138,14 @@
 %! assert (L{3}{3}, 12)
 
 %!test
+%! % list indexing, assign to vars
+%! L = pyeval ("[1, 2, 'Octave']");
+%! [a, b, c] = L{:};
+%! assert (a, 1)
+%! assert (b, 2)
+%! assert (c, "Octave")
+
+%!test
 %! % 2D array indexing
 %! pyexec ("import numpy")
 %! pyexec ("A = numpy.array([[1, 2], [3, 4]])")