[Datetime-SIG] Another round on error-checking

Carl Meyer carl at oddbird.net
Mon Aug 31 21:01:19 CEST 2015


On 08/31/2015 12:58 PM, Alexander Belopolsky wrote:
> On Mon, Aug 31, 2015 at 2:38 PM, Carl Meyer <carl at oddbird.net
> <mailto:carl at oddbird.net>> wrote:
> [Tim Peters]
> 
>     > 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.
> 
> 
> I think the main difference between Tim's current proposal and what was
> previously discussed is that all older proposals somehow required  a
> third value for fold.

Yes, that's true. That's because (unless I'm misunderstanding) Tim is
suggesting something far more audacious than I had considered: making
"raise an error on ambiguity" the default behavior, instead of an opt-in
choice. The extra value for `fold` was just the opt-in mechanism.

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/56110c76/attachment.sig>


More information about the Datetime-SIG mailing list