[Erp5-dev] ERP5 developer-Python.Tutorial: slicing: wrong upper index explanation (bug in docs)

Michael V. Antosha michael.antosha at gmail.com
Fri Aug 19 11:52:49 CEST 2011


Hello,

Reporting a bug in documentation.
Python Tutorial, slide 8 "Lists" (see [1]).

This is from the example in the tutorial (pay attention to the last
line):

   >>> li
   ['baby', 'mom', 'dad']
   >>> li[1]
   'mom'
   >>> li[0:1]
   ['baby', 'mom']

This is how it really works:

   >>> li
   ['baby', 'mom', 'dad']
   >>> li[1]
   'mom'
   >>> li[0:1]
   ['baby']

I also suggest an improvement (inside brackets) to the comments:
"Slicing a list consists of accessing it by giving out two indices.  The
first index will be the starting point and it will take all the elements
up to (but not including) the second index."


[1] Python Tutorial, slide 8 "Lists"
http://www.erp5.com/documentation/developer/developer-Python.Tutorial/img7.html


-- 
Michael V. Antosha
http://identi.ca/mivael
xmpp:mivael at jabber.org

Using Gmail? Please read this important notice:
http://www.fsf.org/campaigns/jstrap/gmail?6278





More information about the Erp5-dev mailing list