Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106446

Re: Set type for datetime intervals

From Random832 <random832@fastmail.com>
Newsgroups comp.lang.python
Subject Re: Set type for datetime intervals
Date 2016-04-04 11:19 -0400
Message-ID <mailman.22.1459783682.32530.python-list@python.org> (permalink)
References <56FE0625.5030901@shopzeus.com> <1459525537.2619077.565849418.5270FACE@webmail.messagingengine.com> <57023EB7.5010804@shopzeus.com> <1459783187.3446187.568436466.56DD4C77@webmail.messagingengine.com>

Show all headers | View raw


On Mon, Apr 4, 2016, at 06:15, Nagy László Zsolt wrote:
> If you define the intersection operation on interval sets only, then you
> need to write something like this:
> 
> if IntervalSet(i1)*IntervalSet(i2):
>     pass
> 
> which is both uglier and an overkill.

I guess what I don't understand in this situation is why aren't i1 and
i2 already IntervalSets? I'm not sure I see why user code would be
working directly with Intervals at all. Any use for it could be replaced
with an IntervalSet constructor to directly make a set of one interval.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Set type for datetime intervals Random832 <random832@fastmail.com> - 2016-04-04 11:19 -0400

csiph-web