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


Groups > comp.lang.python > #96568

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

Path csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <random832@fastmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:: [': 0.03; 'creighton': 0.09; 'logic': 0.09; "object's": 0.09; 'objects.': 0.09; 'received:internal': 0.09; 'themselves,': 0.09; 'stored': 0.10; 'explicitly': 0.15; 'design:': 0.16; 'member)': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'operation.': 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:66.111.4.27': 0.16; 'received:messagingengine.com': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'uniquely': 0.16; 'wrote:': 0.16; 'case.': 0.18; 'laura': 0.18; 'subject:] ': 0.19; 'proposed': 0.20; 'sep': 0.22; 'struct': 0.22; 'subject:skip:i 10': 0.22; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; '14,': 0.27; 'bad.': 0.29; 'itself,': 0.29; 'objects': 0.29; 'somebody': 0.30; 'to:name:python-list': 0.30; 'returned': 0.32; 'problem': 0.33; 'common': 0.33; 'languages': 0.34; 'that,': 0.34; 'could': 0.35; 'functions.': 0.35; "isn't": 0.35; '(and': 0.36; 'subject:" ': 0.36; 'totally': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'received:10': 0.37; 'being': 0.37; 'method': 0.37; 'difference': 0.38; 'itself': 0.38; 'received:66': 0.38; 'subject:-': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'skip:u 10': 0.61; 'header:Message-Id:1': 0.61; 'identify': 0.61; 'providing': 0.62; 'subject:there': 0.66; 'results': 0.66; 'subject:any': 0.84; 'subject:Are': 0.95
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=JSovdxz3r4QMp7mQpu1FtW/VFrA=; b=Rhw7G3 C1inc42NhVdukeF8MMlOTuPXSOlLoh7KQB3GUX95qLdKXd3mtGfrp40xmp5MyoJ5 wJzH1gf7ZKwKx/xNsU0AB65c+z1/TogpYmFEfqpL1+7Y8Vb4ZMH1vrz29EquRbRG axLKyGTK0RESsMUQ2S1FGGbvFLMokpCrjBdy4=
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=JSovdxz3r4QMp7m Qpu1FtW/VFrA=; b=WhN96Q+5/0Xe7Paxv5JL3dDyuF1o80pcyqmfglULrAqC1Xa ifafbEgz3+7AjnWuMtlEdrqNe7SqQSAh3l+5RxyPcMfX7H4xs6ISkTNucecvwh8p YKKK6P8QfbySoNGdidP0npznOqVaRAZX7jbvWuHZciazKakSl3LD+WjqjUHo=
X-Sasl-Enc EhBDrqertjxTY9g6OydjlYBEdoyKoE2337MRS+6570Fl 1442237443
From Random832 <random832@fastmail.com>
To "Python-List" <python-list@python.org>
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 09:30:43 -0400
In-Reply-To <201509140827.t8E8RPqb001076@fido.openend.se>
References <m2h9mzqyy7.fsf@fastmail.com> <CAExdVNm0rrxhbSONfQdor7e=9t+6Tg3hh6eFq-h0NnfdpteVYg@mail.gmail.com> <1442085362.324875.381920729.5E7A6DCE@webmail.messagingengine.com> <CAExdVNnUwRKN2q=trpnD9=mxnXvuosWKO+s5=PCfjAO45-Yugw@mail.gmail.com> <CAP7h-xYFAggqbJBNCZbYFwUqCPzW7-4Rc0x_SzgAumpFYAr6oA@mail.gmail.com> <CAExdVNmfTsqunRR_b-Q1YqWrTjsV1L5ppAoAnL7SUwgR2PFU0A@mail.gmail.com> <CAP7h-xbqq2Eu+vVO2g4WmbRJ=gmL1r9D2sWhKe=qQ8Ev-n415w@mail.gmail.com> <CAP7+vJ+1Vg21qOWAD+9R2REDnWiW4o6nj=Rh8fx3x3cAZipcdw@mail.gmail.com> <CAP7h-xbA6ZagKj+rQ_cCc8d0oK1F329AAhSjY240iiDyB4756A@mail.gmail.com> <CAExdVNnw6zfJQ_wFOurjj6kcLcbr9RgXA7kvyNPmgraMcHU4vQ@mail.gmail.com> <CAP7h-xYp=MsOcvFXNCHNkXDDGH=jcAwYSSw1WWchy5bwZKjwLA@mail.gmail.com> <201509131224.t8DCOXHO004891@fido.openend.se> <CAExdVNkN465=bWeY61PFAxpiUQ-u0p2zaqtwH8PQWyQO4Jw9Mg@mail.gmail.com> <201509131600.t8DG07e0025688@fido.openend.se> <CAExdVNm3e43mJ3tqcUc9175WssV4zeuO024svJbMTjrTab=Qew@mail.gmail.com> <201509132031.t8DKVTwJ028027@fido.openend.se> <CAExdVNkeRVgV8CXLugMgqhUSuXU=qHYSFUo24Xw83X=8tVBjCg@mail.gmail.com> <201509140827.t8E8RPqb001076@fido.openend.se>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.531.1442237446.8327.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1442237446 news.xs4all.nl 23737 [2001:888:2000:d::a6]:51299
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:96568

Show key headers only | View raw


On Mon, Sep 14, 2015, at 04:27, Laura Creighton wrote:
> I find this totally unacceptable.  My conclusion was that hybrid tzinfo
> objects were a _really stupid idea_ proposed by somebody who
> misunderstood
> the problem, or rather only understood the most common case.

"Hybrid tzinfo objects" _in isolation_ are not bad. The problem isn't
the objects themselves, it's the whole design:

1. Hybrid tzinfo objects
2. Attached tzinfo object as the _only_ way to identify the timezone of
a datetime (no offset member)
3. Datetime itself stored in local time.

There's a reason that other languages store the offset explicitly -
because it causes the datetime+offset object to uniquely identify a
specific moment in time, and _without_ having to call in to any complex
logic [i.e. the tzinfo object's utcoffset method]. Normalizing the
results of "classic arithmetic" could (and should) be solved by
providing a hook that calls a method on the tzinfo object to find the
new offset for the result of the operation.

A "hybrid tzinfo object" is itself, in principle, exactly the same kind
of thing that, in C, is returned by tzalloc and used by localtime_rz, on
systems that have those functions. The difference is, this object is
explicitly managed rather than being "attached" to struct tm objects.

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


Thread

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo? Random832 <random832@fastmail.com> - 2015-09-14 09:30 -0400

csiph-web