Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #106449
| From | Random832 <random832@fastmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: ANN: intervalset Was: Set type for datetime intervals |
| Date | 2016-04-04 11:44 -0400 |
| Message-ID | <mailman.24.1459784665.32530.python-list@python.org> (permalink) |
| References | (1 earlier) <1459523394.2611014.565840994.593DD99A@webmail.messagingengine.com> <570213CB.8040101@shopzeus.com> <1459782597.3444051.568344234.048046C6@webmail.messagingengine.com> <CAHVvXxRRmJKHq-H8xotY9yF+pzG+7NOSMhOwTbL4qF-N4XjTfQ@mail.gmail.com> <1459784663.3451967.568464658.50905009@webmail.messagingengine.com> |
On Mon, Apr 4, 2016, at 11:32, Oscar Benjamin wrote: > On 4 April 2016 at 16:09, Random832 <random832@fastmail.com> wrote: > > Like I said before, I don't think the set-like operations on Intervals > > are useful - what can you accomplish with them rather than by making a > > set consisting of only one interval and doing operations on that? > > I guess it depends what your application is but sympy has interval > sets and can do computation on them to represent the solutions of > equations/inequalities (many other types of set are also included). Yes, my question is why it's useful to have a single Interval as a *distinct* type, separate from the interval set type, which supports a sharply limited number of set-like operations (such as the union of two overlapping intervals but NOT two non-overlapping ones). This doesn't appear to be the case in sympy based on your examples. Having an interval as a distinct type may be useful (to iterate over the intervals of a set, for example), but his design blurs the line between intervals and sets (by supporting some set operations) without eliminating it as sympy seems to do. > In [6]: Interval(1, 2) | Interval(3, 4) > Out[6]: [1, 2] ∪ [3, 4] > > There is some discussion about why it's good to do this stuff with > sets (for sympy's purposes here): > http://docs.sympy.org/latest/modules/solvers/solveset.html#why-do-we-use-sets-as-an-output-type
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: ANN: intervalset Was: Set type for datetime intervals Random832 <random832@fastmail.com> - 2016-04-04 11:44 -0400
csiph-web