Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Random832 Newsgroups: comp.lang.python Subject: Re: Set type for datetime intervals Date: Mon, 04 Apr 2016 11:19:47 -0400 Lines: 13 Message-ID: References: <56FE0625.5030901@shopzeus.com> <1459525537.2619077.565849418.5270FACE@webmail.messagingengine.com> <57023EB7.5010804@shopzeus.com> <1459783187.3446187.568436466.56DD4C77@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de 7aUie9tNRqdV2ykbdTSaFQbHgdBiuy6BOuvAsyrDyLVQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'constructor': 0.07; 'only,': 0.07; 'received:internal': 0.09; 'intersection': 0.16; 'interval.': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'subject:type': 0.16; 'wrote:': 0.16; "aren't": 0.22; 'pass': 0.22; 'sets': 0.23; 'this:': 0.23; 'header:In-Reply-To:1': 0.24; 'all.': 0.24; 'mon,': 0.24; 'define': 0.27; "i'm": 0.30; 'code': 0.30; 'guess': 0.31; 'could': 0.35; 'replaced': 0.35; 'something': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'received:66': 0.38; 'why': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.40; 'header:Message-Id:1': 0.61; 'situation': 0.67; 'nagy': 0.84; 'subject:Set': 0.91 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=6tP2moaMBRvs1l1ge+C6ntcVv/s=; b=eXOA0X IkFb/HB1+5bwpiAr/oo7OWg278osEHaXX2KOQ6KTfqaclZFwYznDvkcq4ZzL+iEx YcGgx0wNIyXU29AJdgLw0bJUrEgkVTDE244f33ChFY6uXeKZBKy5Y6DzDFtVIdeT 2C0ScbhC8AhZlOU5sQ+ZC4BKDcb9PbTJi9mWY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=6tP2moaMBRvs1l1 ge+C6ntcVv/s=; b=uHukh8P24N6gHNyA4h7n5GP/9h36LFYJmvcYTjoI1Lj3GEF /OLZQdFFyg9zArWzxplcgSq77WfyDQWjeFnGk2OWSy02LDgwyZr1UficNZG8i9uD 9USjzULjwhdoTip77uJzoo3DiaWCYzjAqDV9PO6dj2meHDLd8NHBt58WjaEo= X-Sasl-Enc: ngyeA3gJyqQ2acgkeNbd0wAo+FdwWh5j7QH1qHiqrMc4 1459783187 X-Mailer: MessagingEngine.com Webmail Interface - ajax-2373d6a1 In-Reply-To: <57023EB7.5010804@shopzeus.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <1459783187.3446187.568436466.56DD4C77@webmail.messagingengine.com> X-Mailman-Original-References: <56FE0625.5030901@shopzeus.com> <1459525537.2619077.565849418.5270FACE@webmail.messagingengine.com> <57023EB7.5010804@shopzeus.com> Xref: csiph.com comp.lang.python:106446 On Mon, Apr 4, 2016, at 06:15, Nagy L=C3=A1szl=C3=B3 Zsolt wrote: > If you define the intersection operation on interval sets only, then you > need to write something like this: >=20 > if IntervalSet(i1)*IntervalSet(i2): > pass >=20 > 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.