class_docstr: Apply Python slice object to Polars DataFrame or Series.
  
  Has full support for negative indexing and/or stride.
docstr: Normalise slice bounds, identify unbounded and/or zero-length slices.
docstr_tok: ["Normalise","slice","bounds",",","identify","unbounded","and\/or","zero-length","slices","."]
code: def _slice_setup(self, s: slice) -> None:
      """Normalise slice bounds, identify unbounded and/or zero-length slices."""
      # can normalise slice indices as we know object size
      obj_len = len(self.obj)
      start, stop, stride = slice(s.start, s.stop, s.step).indices(
          obj_len
      )
  
      # check if slice is actually unbounded
      if stride >= 1:
          self.is_unbounded = (start <= 0) and (stop >= obj_len)
      else:
          self.is_unbounded = (stop == -1) and (start >= obj_len - 1)
  
      # determine slice length
      if self.obj.is_empty():
          self.slice_length = 0
      elif self.is_unbounded:
          self.slice_length = obj_len
      else:
          self.slice_length = (
              0
              if (
                  (start == stop)
                  or (stride > 0 and start > stop)
                  or (stride < 0 and start < stop)
              )
              else abs(stop - start)
          )
      self.start, self.stop, self.stride = start, stop, stride
  
file_path: polars/py-polars/polars/slice.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Union
  import polars._reexport
label_desc: Use image node_id 6 for calling the PolarsSlice obj's underlying member method code with example usage: obj._slice_setup(s) without return types