[Datetime-SIG] Another round on error-checking
Carl Meyer
carl at oddbird.net
Mon Aug 31 20:38:31 CEST 2015
On 08/31/2015 12:34 PM, Tim Peters wrote:
> [Carl Meyer <carl at oddbird.net>]
>> That's pretty much what I proposed in the first invalid-time-checking
>> thread. Alex didn't like it because `utcoffset()` is called from so many
>> different places:
>> https://mail.python.org/pipermail/datetime-sig/2015-August/000499.html
>
> That is a potential problem.
>
>> AFAICT, you are re-proposing the same solution you characterized several
>> times earlier as "spraying errors all over the place" and "going nowhere
>> fast." :-)
>
> Nope. There's nothing here about, e.g., messing with datetime
> constructors, .replace(), .combine() ... "naive time" is left alone
> here. It's only timezone-specific operations targeted here, which are
> all implemented _by_ tzinfo objects. Not by datetime itself.
There wasn't any of that stuff (messing with constructors, or replace,
or combine, or naive time) in what Alex and I were discussing in the
other thread, either. Just the idea of having `utcoffset()` raise an
error if it hit an ambiguity.
Carl
-------------- 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/20150831/a9e1a1bd/attachment.sig>
More information about the Datetime-SIG
mailing list