Skip to content

slicecompose v0.1.0

Choose a tag to compare

@isarandi isarandi released this 16 Jul 22:41

Initial release.

  • compose(s1, s2): returns a slice equivalent to arr[s1][s2] for every sequence length, or None when no such slice exists — sound and complete in both directions.
  • SliceChain: reduces chains of slices by adjacent-pair merging.
  • SlicePlan / s_: lazy plan building with ordinary bracket notation, e.g. s_[2:][3:].slice == slice(5, None).

Pure Python, standard library only. See EXPLANATION.md for the soundness/completeness argument.