The type object for slice objects. This is the same asslice andtypes.SliceType.
Return a new slice object with the given values. Thestart,stop, andstep parameters are used as the values of the slice object attributes of thesame names. Any of the values may beNULL, in which case theNone will beused for the corresponding attribute. ReturnNULL if the new object could notbe allocated.
Retrieve the start, stop and step indices from the slice objectslice,assuming a sequence of lengthlength. Treats indices greater thanlength aserrors.
Returns 0 on success and -1 on error with no exception set (unless one of theindices was notNone and failed to be converted to an integer, in whichcase -1 is returned with an exception set).
You probably do not want to use this function. If you want to use slice objectsin versions of Python prior to 2.3, you would probably do well to incorporatethe source ofPySlice_GetIndicesEx, suitably renamed, in the source ofyour extension.
Usable replacement forPySlice_GetIndices. Retrieve the start, stop,and step indices from the slice objectslice assuming a sequence of lengthlength, and store the length of the slice inslicelength. Out of boundsindices are clipped in a manner consistent with the handling of normal slices.
Returns 0 on success and -1 on error with exception set.
New in version 2.3.