[Datetime-SIG] PEP-495 - Strict Invalid Time Checking

Carl Meyer carl at oddbird.net
Tue Aug 25 23:28:32 CEST 2015

On 08/25/2015 03:22 PM, Alexander Belopolsky wrote:
> On Tue, Aug 25, 2015 at 5:04 PM, Carl Meyer <carl at oddbird.net
> <mailto:carl at oddbird.net>> wrote:
>     I can't imagine how raising an exception on invalid times only if a
>     non-default sentinel value is given for a flag that is _new in PEP 495_
>     could possibly break 4000 lines of existing datetime tests.
> OK, so datetime module itself will never set fold=-1.   In the list
> below, can you mark the methods that need to be patched to check the
> fold attribute in your preferred design:
> Please ask Isaac and Stuart to do the same.  Once you agree on a list,
> let's continue this discussion.

My answer is "only in those same locations where the fold attribute
would otherwise be checked in order to resolve an ambiguity." That is, I
wouldn't introduce any new checks: only and exactly where PEP 495 would
otherwise make a guess based on the fold attribute should it raise an
exception if the fold attribute is set to a "don't guess" sentinel (for
which I'd prefer None to -1, since the latter invites confusion with


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

More information about the Datetime-SIG mailing list