Mercurial > pytave
comparison @pyobject/subsasgn.m @ 369:540b36e797c8
Reduce number of function calls, clean up formatting in subasgn and subsref
* @pyobject/subsasgn.m: Reduce number of pycalls.
* @pyobject/subsref.m: Reduce number of pycalls. Clean up code formatting.
Add type checks for '()' indexing, explicit error message about slice indexing.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Thu, 25 Aug 2016 23:20:02 -0700 |
parents | 9d7188514f2c |
children | 3613ffbd52b2 |
comparison
equal
deleted
inserted
replaced
368:4d54fb68de71 | 369:540b36e797c8 |
---|---|
63 ind = idx.subs{1}; | 63 ind = idx.subs{1}; |
64 else | 64 else |
65 ind = pycall ("tuple", idx.subs); | 65 ind = pycall ("tuple", idx.subs); |
66 endif | 66 endif |
67 | 67 |
68 xsi = pycall ("getattr", x, "__setitem__"); # x.__setitem__ | 68 pycall ("operator.setitem", x, ind, rhs); |
69 pycall (xsi, ind, rhs); | |
70 r = x; | 69 r = x; |
71 | 70 |
72 otherwise | 71 otherwise |
73 idx | 72 idx |
74 rhs | 73 rhs |