Path: csiph.com!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed7.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.03; 'cc:addr:python-list': 0.09; 'defined,': 0.09; 'mess': 0.09; 'portable': 0.09; 'received:internal': 0.09; 'python': 0.10; 'assume': 0.11; 'extensions': 0.13; 'argument': 0.15; 'explicitly': 0.15; '"your': 0.16; '*a*': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'naive': 0.16; 'pathological': 0.16; 'peters': 0.16; 'posix': 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:messagingengine.com': 0.16; 'tm_zone': 0.16; 'utc': 0.16; 'wrote:': 0.16; 'subject:] ': 0.19; 'cc:addr:python.org': 0.20; 'prevent': 0.20; 'cc:2**1': 0.22; 'along.': 0.22; 'assuming': 0.22; 'fine,': 0.22; 'sep': 0.22; 'subject:skip:i 10': 0.22; 'defined': 0.23; "python's": 0.23; 'tim': 0.24; 'header:In- Reply-To:1': 0.24; 'discussion': 0.24; 'mon,': 0.24; 'sort': 0.25; "doesn't": 0.26; 'equivalent': 0.27; '14,': 0.27; 'converting': 0.27; 'specifically': 0.28; 'values': 0.28; 'fine': 0.28; 'cases.': 0.29; 'pickle': 0.29; 'objects': 0.29; 'asked': 0.29; 'there.': 0.30; "i'm": 0.30; '(including': 0.30; 'that.': 0.30; 'code': 0.30; 'minimal': 0.30; "can't": 0.32; 'table': 0.32; 'older': 0.32; 'correctly': 0.34; 'world,': 0.35; 'done': 0.35; 'quite': 0.35; "isn't": 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'possible.': 0.36; 'possible': 0.36; 'cases': 0.36; 'loaded': 0.36; 'subject:" ': 0.36; 'subject:?': 0.36; 'received:10': 0.37; 'available.': 0.37; 'no,': 0.38; 'presence': 0.38; 'received:66': 0.38; 'mean': 0.38; 'format': 0.39; 'enough': 0.39; 'subject:-': 0.39; 'ever': 0.60; 'skip:u 10': 0.61; 'header :Message-Id:1': 0.61; 'provide': 0.61; 'total': 0.62; 'more': 0.63; 'today': 0.65; 'subject:there': 0.66; "they're": 0.66; 'talking': 0.67; 'worth': 0.67; 'obtained': 0.76; 'vital': 0.76; 'claim.': 0.84; 'crafted': 0.84; 'pickled': 0.84; 'standards,': 0.84; 'subject:any': 0.84; 'subject:Are': 0.95 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h=cc :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=0FOXx/hHnL0KjRFyUA6AsR6xLU0=; b=1ltrqm Js7rZz3UP/al+nUIIf7EJQ6aZk6n76bls7pSWtyicJ6ILzZHSqcZC/yUfpPibgG2 N/eqdKD71f9mDKwo+c0w5WYCCmDoDSO9hNPAoWTIvqd42O5ug8RgxMDxIwD0UMI9 4Ial/r3prXIq4VZ6cWXe3b/L1/dGsgGekWwKg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=0FOXx/hHnL0KjRF yUA6AsR6xLU0=; b=RImZQzP6ltp3nEe5/UUqQf7LHM5p1G8iImY/38vOv4VBIwN DAF1nhrwnjfPygKHqlgoUFmcryP6MPcjnEmDit+M/N+pKFx1p/2YlhUf5Bg2x9fH kdO5+vIGa5wdOPvzIUsIHNdd9vM+eJ6Dojz9bGjRBcsXu6a8xa6RrgTYqqvI= X-Sasl-Enc: BxyUVuhwfKUx/4d8FBccbSA4jFfTLnJzWClWME7Lov9n 1442260714 From: Random832 To: Tim Peters Cc: "Python-List" , "datetime-sig" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-c76b43ce Subject: Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo? Date: Mon, 14 Sep 2015 15:58:34 -0400 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> 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: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442260723 news.xs4all.nl 23831 [2001:888:2000:d::a6]:34417 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96597 On Mon, Sep 14, 2015, at 15:30, Tim Peters wrote: > You're assuming much more than POSIX - and the ISO C standard - > requirs. My description was quite explicitly about how POSIX has done > it all along. tm_gmtoff and tm_zone are extensions to the standards, > introduced (IIRC) by BSD. Portable code (including Python's > implementation) can't assume they're available. No, but that doesn't mean it's not in fact true (what was under discussion was "your own machine", not "a minimal POSIX implementation"). And it doesn't mean it's not a best practice that python can and should copy. I'm not talking about *using* it, I'm talking about working the same way independently, so this has nothing to do with assuming it's available. > It was off the table because, for backward compatibility, we need to > mess with the pickle format as little as possible. It's vital that > datetimes obtained from old pickles continue to work fine, and that > pickles obtained from new datetime objects work fine when loaded by > older Pythons unless they actually require the new fold=1 possibility. I don't see how this would prevent that. Aware datetimes have a tzinfo *right there* that can be asked for a value to populate utcoffset with if there isn't a pickled one. > > (No, I don't *care* how that's not how it's defined, > > ? How what is defined?: Just trying, unsuccessfully apparently, to head off the "no, it's defined as working the same as a naive datetime if the tzinfo values are the same" argument that got brought up the *last* time I made this claim. > > it is *in fact* true for the UTC value that you will ever actually get > > from converting the values to UTC *today*, and it's the only total > > ordering that actually makes any sense) > > Well, you lost me there. In a post-495 world, conversion to UTC will > work correctly in all cases. It cannot today.; It'll provide *a* value in all cases. The sort order today is equivalent to using that value in all cases unless you've got a pathological tzinfo specifically crafted to break it. I think that's an important enough invariant to be worth keeping, since it is the only possible way to provide a total order in the presence of interzone comparisons.