Raymond Hettinger <[EMAIL PROTECTED]> wrote:
><[EMAIL PROTECTED]>
>> Many people I know ask why Python does slicing the way it does.....
>Python's way has some useful properties:
>
>* s == s[:i] + s[i:]
>
>* len(s[i:j]) == j-i     # if s is long enough

The latter being particularly helpful when i = 0 -- the first n
elements are s[:n] . (Similarly elegantly, although of no
practical significance, s == s[0:len(s)] .)

-- 
\S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomež se bera eadward ofdun hlęddre heafdes bęce bump bump bump
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to