[docs] [Documentation bug found]

Zachary Ware zachary.ware+pydocs at gmail.com
Mon Mar 31 16:12:20 CEST 2014


Hi,

On Mon, Mar 31, 2014 at 8:12 AM, Jilin Yang <Jilin.Yang at student.oulu.fi> wrote:
> Url:
> https://docs.python.org/2/tutorial/datastructures.html#the-del-statement
>
>
> Location : First example of 5.2
>
>
> Description:
>
> Found output after operation "del a[2:4]" is wrong, which should be
> [-1,1,333,1234.5], not [1,66.25,1234.5] if you type in "a" in python command
> line afterwards.

Thanks for the report!  However, there is no bug here; notice that
before the 'del a[2:4]' operation, there is 'del a[0]', which removes
-1 from the beginning of ``a`` and leaves [1, 66.25, 333, 333,
1234.5].  At that point, a[2:4] == [333, 333], and deleting a[2:4]
leaves [1, 66.25, 1234.5] as shown in the documentation.

Hope this clears things up,
-- 
Zach


More information about the docs mailing list