Path: csiph.com!eternal-september.org!feeder.eternal-september.org!goblin1!goblin2!goblin.stu.neva.ru!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.03; 'see.': 0.07; 'cc:addr:python-list': 0.09; 'defined,': 0.09; 'semantics': 0.09; 'stored': 0.10; 'argument': 0.15; '*a*': 0.16; 'all"': 0.16; 'bit.': 0.16; 'code?': 0.16; 'fold': 0.16; 'naive': 0.16; 'pathological': 0.16; 'preserved': 0.16; 'readable': 0.16; 'tm_zone': 0.16; 'utc': 0.16; 'later': 0.16; 'string': 0.17; 'subject:] ': 0.19; '>>>': 0.20; 'cc:addr:python.org': 0.20; 'work,': 0.21; 'cc:2**1': 0.22; 'latter': 0.22; 'sorry,': 0.22; 'subject:skip:i 10': 0.22; 'defined': 0.23; '(or': 0.23; 'header :In-Reply-To:1': 0.24; 'sort': 0.25; 'earlier': 0.27; 'compare': 0.27; 'equivalent': 0.27; 'message-id:@mail.gmail.com': 0.27; 'converting': 0.27; 'correct': 0.28; 'specifically': 0.28; 'values': 0.28; 'about.': 0.29; 'cases.': 0.29; 'if,': 0.29; 'pickle': 0.29; 'objects': 0.29; 'there.': 0.30; 'too.': 0.30; "can't": 0.32; 'older': 0.32; 'view,': 0.33; 'correctly': 0.34; 'equal': 0.34; 'add': 0.34; 'received:google.com': 0.35; 'world,': 0.35; 'something': 0.35; 'but': 0.36; 'possible': 0.36; 'cases': 0.36; 'subject:" ': 0.36; 'subject:?': 0.36; 'no,': 0.38; 'presence': 0.38; 'enough': 0.39; 'subject:-': 0.39; 'still': 0.40; 'some': 0.40; 'ever': 0.60; 'your': 0.60; 'skip:u 10': 0.61; 'provide': 0.61; 'show': 0.62; 'total': 0.62; 'today': 0.65; 'subject:there': 0.66; "they're": 0.66; 'talking': 0.67; 'worth': 0.67; 'about?': 0.84; 'claim.': 0.84; 'crafted': 0.84; 'doable': 0.84; 'subject:any': 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=EodApTtdtIAZNd3Vk4o5PyryamfCvLZKkhEGgaf8jI4=; b=IsWZ28PQSDjOOuiXweU8oXVglh1eEa53SJMpItJM7UgwfGyWc0YGT9US+l3ZeS907s +UFBo7Y0aEk/w/GyK6WaSetHUNhEFZZaaqCrsf+Tal1SPMuPCFYtU6wUxuay5WHOXjGQ uTyMVF/laDa9nWMAVS16AwWV3C7uCYALigxiNsvPf5X9bdJzzHttyr61DdvCxsHqbEUb rBzwWl84dNc5/qBFY7KXzDjK7VSpiMXkVx9PkUqppwcArirUn2LPmsbtNBodsuVtR8UU 72k0LTaMwLXifoGond7JZRo8F4cTly8rTSgQxDX+Ca3MS96fL4omhNPLb2V2HCo1XakC YxMA== X-Received: by 10.202.106.195 with SMTP id f186mr13001978oic.27.1442261750616; Mon, 14 Sep 2015 13:15:50 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1442260714.263025.383475777.4728D768@webmail.messagingengine.com> 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> <1442260714.263025.383475777.4728D768@webmail.messagingengine.com> From: Tim Peters Date: Mon, 14 Sep 2015 15:15:35 -0500 Subject: Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo? To: Random832 Cc: 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: 50 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442261753 news.xs4all.nl 23745 [2001:888:2000:d::a6]:45692 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96600 [Random832 ] Whether or not datetimes stored tm_gmtoff and tm_zone workalikes has no effect on semantics I can see. If, in your view, they're purely an optimization, they're just a distraction for now. If you're proposing to add them _instead_ of adding `fold`, no, that can't work, for the pickle compatibility reasons already explained. Whether something is in a fold needs to preserved across pickling, but "almost all" pickles need to be readable by older Pythons too. This is doable adding one bit, but not doable at all if we need to add arbitrary timedelta and string objects _instead_ of that bit. ... >>> (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. Sorry, I still don't know what this is about. >>> 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. It will provide the correct UTC offset 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. Show some code? I don't know what you're talking about. It is true that the earlier and later of an ambiguous time in a fold will compare equal in their own zone, but compare not equal after conversion to UTC (or to any other zone in which they're not in one of the latter zone's folds). Is that what you're talking about?