Slice Attributes

slice.stop

Raw exclusive ending bound. It may be None, negative, or outside the target sequence; it is not a normalized endpoint. A one-argument slice(stop) stores that argument here. This read-only attribute preserves the original object reference, not a converted integer. Use indices(length) to normalize for a concrete sequence.

Formal Syntax & Structure

python syntaxpython
value.stop

Return Value

object | None

Original argument or None.

Working Example

Example Snippetpython
s = slice(1, -1)print(s.stop)print(slice(4).stop)
Python Reference