James Tauber

journeyman of some

blog > 2005 > 08 >

James Tauber's Blog 2005/08/16

Python Slice Questions

1. why does

a[:]

call a.__getitem__ with an argument:

slice(0, 2147483647, None)

instead of

slice(None, None, None)

2. where are slice lists, like:

a[1,2,3]

documented? The only place I've found is the language reference but the semantics are not explained there. Does this feature exist purely for Numeric Python?

UPDATE: slice lists have existed since 1.4 it appears.

by jtauber : Created on Aug. 17, 2005 : Last modified Aug. 17, 2005 : Categories python : 6 comments (permalink)