kvesteri / intervals

Python tools for handling intervals (ranges of comparable objects).
BSD 3-Clause "New" or "Revised" License
107 stars 17 forks source link

Are intervals with the same lower and upper but inclusive of one and exclusive of the other valid? #36

Closed vansivallab closed 7 years ago

vansivallab commented 7 years ago

I'm able to create an interval with the same lower and upper bound but one bound is inclusive and other other is exclusive. However this seems like an invalid interval to me because such abound seems to suggest that a value is both included and excluded from the interval.

As an example:

>>> Interval(1,1, lower_inc=True, upper_inc=False)
IntInterval('[1,1)')
vansivallab commented 7 years ago

This seems intentional based off the docs: https://github.com/kvesteri/intervals#interval-initialization