[IPython-user] Macros & slice notation

Ryan Krauss ryanlists at gmail.com
Fri Dec 30 12:18:23 CST 2005


The python slice notation is counter-intuitive to me, but forcing
myself to think that way makes thinking that way all the time
reasonable.

So, I am in favor of leaving it the way it is.

Ryan

On 12/30/05, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
> Alan G Isaac wrote:
> > On Fri, 30 Dec 2005, Fernando Perez apparently wrote:
> >
> >>we could change the range syntax in %macro and %save to use
> >>N-M
> >
> >
> > Maybe N--M?
>
> Why the extra dash?  This is not an arithmetic operation: magics already
> handle 'command-line' dashed flags, so I'm not sure I see the need for '--'
> instead of just '-'.
>
> >>instead of N:M
> >
> >
> > Maybe as an alternative to regular slices,
> > which would still work as expected (by Python users).
>
> Do you mean having both?  I'm -0.5 on that: too many ways of doing things is a
> recipe for unnecessary confusion (think perl).  I'd rather have one, good and
> intuitive way to do it: the human brain (at least mine :) is good at
> remembering specific use cases, as long as they remain reasonably orthogonal.
>   What gets confusing is having to deal with things that are 'kind of the
> same, but not really': I think I'd stop each time to think, 'is this a slice
> or not?'.  If I simply know that 'line ranges are given as N-M, where N and M
> are the endpoints I want, as shown by %hist', then there's no confusion.
>
> Just my 1e-2.
>
> Cheers,
>
> f
>
> _______________________________________________
> IPython-user mailing list
> IPython-user at scipy.net
> http://scipy.net/mailman/listinfo/ipython-user
>




More information about the IPython-user mailing list