Ok. I tried some variation of a get() call, but I had no idea I needed to 
use pybuiltin(:slice). Thanks!

On Tuesday, March 15, 2016 at 6:52:58 PM UTC-4, Steven G. Johnson wrote:
>
> s = pybuiltin(:slice)
>
> get(np.mgrid, (s(0,5), s(0,5)))
>
>
> works.   (In general, foo[bar, baz] in Python needs to be get(foo, 
> (bar,baz)) in PyCall at the moment, because foo[...] is used for 
> attributes.)
>
>
> It would be nice if you could just use 0:5 here, but 0:5 is currently 
> translated into an xrange object in Python, not a slice.   I'm not sure if 
> slice would be a better default translation?   (I don't understand why 
> Python has slice, xrange, and itertools.islice, all of which seem like they 
> could be collapsed into a single type.)
>

Reply via email to