[Datetime-SIG] Another round on error-checking

Carl Meyer carl at oddbird.net
Fri Sep 4 19:50:23 CEST 2015

> Eh.  It's not perfect, but I don't know that anyone (present company
> excepted) will care much.  It matters only for the later of ambiguous
> times in at worst (in common zones) one hour per year, and then only
> for someone using classic datetime-datetime subtraction or comparison
> starting in _some_ (not all) cases in such a fold.
> Perhaps this makes it wholly unusable.  I doubt most would reach that
> conclusion, but it's possible.

It's certainly not wholly unusable; I'd never claim that. We can have
reasonable disagreement about whether it's the best option available.

I think it's reasonable (in principle; pending working code) to tie
fully-consistent timezone conversions to full consistency in general,
and make it a migration choice, leaving existing working code entirely
alone. You (and Alex and PEP 495) think consistent timezone-conversion
round-trips are a valuable enough addition (even for existing code
that's already working) to be worth pragmatically trading off some
consistency and backwards-compatibility in other edge cases. I can see
your point of view, and I think it's a reasonable disagreement to have.
And I don't have much leg to stand on until I provide a working patch
for my point of view, since Alex already has one for yours :-)

> Of course nobody will (or should even try to) remember all those
> cases.  An app that really cares (if any exist - none of my code
> cares) will need to "do something" about it.  Or we'll need to add
> code to ignore `fold` if a pre-495 tzinfo is in use (in which case
> nothing will change if they stick to pre-495 tzinfos).

I'm actually quite curious how many homegrown tzinfo implementations
exist in the wild, or if we're really just talking about "dateutil.tz
users" vs "pytz users". When you talk about "your code", which bucket
does it fall into? Clearly not the latter - are you a "homegrown tzinfo"
user, or a dateutil.tz user?

> This part isn't driven a model; it's driven by pragmatism
> ("practicality beats purity").  The sanest model is "it's classic
> unless you're near a fold, and if you care anything about what happens
> then when doing classic arithmetic you're wasting your time:  e.g.,
> force it out of a fold if you need to care".



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150904/a442318e/attachment.sig>

More information about the Datetime-SIG mailing list