[IPython-user] Macros & slice notation

Ville Vainio vivainio at gmail.com
Fri Dec 30 11:42:38 CST 2005


Now that I took the while to look into macros, I wondered what is the
rationale for using the python slice notation (i.e. 5:7 takes lines
5,6 and not including 7). It seems a bit counter-intuitive considering
that it always deals with line numbers, and once you do "hist" and see
the line numbers, you *are* going to think 5:7 means "take lines
5,6,7". I understand that the python slice notation has its advantages
(esp. when the step != 1) but for line numbers it seems a bit
unpractical. With line numbers the users won't be thinking of
intervals between lines.

It's not a major issue, really, but I'd expect it to be a minor gotcha
for many users. I understand the argument of consistency with the rest
of Python, of course.

--
Ville Vainio    http://tinyurl.com/2prnb
  Can't you see the world is burning
  Can't you feel its Fire burning
  Don't you know we all are burning
  The Fire of Life       -- R.N.Taylor / Changes




More information about the IPython-user mailing list