Is there a discontinuous range class for Python?

后端 未结 2 1486
耶瑟儿~
耶瑟儿~ 2021-01-18 01:21

I\'d like to represent an arbitrarily complex range of real values, which can be discontinuous, i.e.:

0--4 and 5--6 and 7.12423--8

Where I\

2条回答
  •  -上瘾入骨i
    2021-01-18 01:52

    There are at least a couple of packages listed in the Python Package Index which deal with intervals:

    • interval

    • pyinterval

    I've experimented with interval before and found it to be well-written and documented (at the moment its website seems to be unavailable). I've not used pyinterval.

提交回复
热议问题