Path: csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.03; 'cpython': 0.05; 'method.': 0.05; 'computed': 0.07; 'implements': 0.07; 'cc:addr:python-list': 0.09; 'agree,': 0.09; 'python': 0.10; '(at': 0.13; 'applies': 0.15; '4-byte': 0.16; 'utc': 0.16; 'exists': 0.18; 'integer': 0.18; ';-)': 0.18; 'programmer': 0.18; 'subject:] ': 0.19; 'cc:addr:python.org': 0.20; 'cc:2**2': 0.20; 'subject:skip:i 10': 0.22; 'header:In-Reply-To:1': 0.24; 'not.': 0.27; 'least': 0.27; 'message-id:@mail.gmail.com': 0.27; "i'm": 0.30; 'that.': 0.30; 'code': 0.30; 'seconds': 0.31; 'implement': 0.32; 'expensive': 0.32; 'skip:. 10': 0.32; 'received:google.com': 0.35; 'authors': 0.35; 'should': 0.36; 'depends': 0.36; 'faster': 0.36; 'subject:" ': 0.36; 'subject:?': 0.36; 'turn': 0.37; 'no,': 0.38; 'does': 0.39; 'subject:-': 0.39; 'more': 0.63; 'times': 0.63; 'within': 0.64; 'subject:there': 0.66; 'firing': 0.84; 'premature': 0.84; 'subject:any': 0.84; 'worried': 0.84; 'subject:Are': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=G2STDmM0WzDckaUHb+p8KdjU8qc9sx+TFiJC/241yzI=; b=PTyYSKr0wQFxizogCU3utnvmMTBIAArY/mKbrDkap3folQqKp2RbVP+PZWNSalVmCF UAdPUXyJrebUnWTG11poGpYR0XlYI/osUbzggEd2+jQ+6WSDWntJcVdTVR89iklN/m14 gc5Q/H/oAQgxyeO4+wtkkwfvE1ZoQnJ0wYspdJW3TTDZTv61tVRt3EMFZ5byAAgy4Prh 6Qrs8JnGc3dJUWbU74H+3w6hgFNNe/1XOWGkFGqcyFSyozShhqDwmM/xtERpCAPG/Os1 ngztaoXcd7QaV1MWr77Z/j4NLVpQqqR1wDPFPmhuzGG7L0VveJYgf/eiy3pG4rZi2QS0 mLzQ== X-Received: by 10.182.28.165 with SMTP id c5mr14170579obh.29.1442262185682; Mon, 14 Sep 2015 13:23:05 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1442085362.324875.381920729.5E7A6DCE@webmail.messagingengine.com> <201509131224.t8DCOXHO004891@fido.openend.se> <201509131600.t8DG07e0025688@fido.openend.se> <201509132031.t8DKVTwJ028027@fido.openend.se> <201509140827.t8E8RPqb001076@fido.openend.se> <1442257996.253100.383441705.7A0986C7@webmail.messagingengine.com> From: Tim Peters Date: Mon, 14 Sep 2015 15:22:50 -0500 Subject: Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo? To: Alexander Belopolsky Cc: Random832 , Python-List , datetime-sig Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442262194 news.xs4all.nl 23787 [2001:888:2000:d::a6]:51210 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96602 [Tim] >> It depends on how expensive .utcoffset() >> is, which in turn depends on how the tzinfo author implements it. [Alex] > No, it does not. In most time zones, UTC offset in seconds can be computed > by C code as a 4-byte integer Which is a specific implementation of .utcoffset(). Which likely has nothing to do with how most tzinfo authors will implement _their_ .utcoffset(). For example, look at any tzinfo.utcoffset() implementation that currently exists ;-) > faster > than CPython can look up the .utcoffset method. (At least for times > within a few years around now.) A programmer who makes it slower should > be fired. So any programmer who implements .utcoffset() in Python should be fired? That's the only way I can read that. > Yet I agree, "'premature optimization' applies at this time." I'm more worried now about premature firing ;-)