Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 814 Bytes

ranges.md

File metadata and controls

36 lines (27 loc) · 814 Bytes

Ranges

A utility for working with ranges

The basic building block of the module is the Range class.

Usage

A few examples:

from xocto.ranges import Range, RangeBoundaries
> > > Range(0, 2, boundaries=RangeBoundaries.EXCLUSIVE_INCLUSIVE)
> > > <Range: (0,2]>
> > > 0 in Range(0, 2)
> > > True
> > > 2 in Range(0, 2)
> > > False
> > > date(2020, 1, 1) in Range(date(2020, 1, 2), date(2020, 1, 5))
> > > False
> > > sorted([Range(1, 4), Range(0, 5)])
> > > [<Range: [0,5)>, <Range: [1,4)>]

See xocto.ranges for more details, including examples and in depth technical details.

API Reference

.. module:: xocto.types

.. automodule:: xocto.ranges
   :members:
   :undoc-members:
   :show-inheritance: