[Datetime-SIG] Local time disambiguation proposal

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Jul 30 21:30:42 CEST 2015


On Thu, Jul 30, 2015 at 1:46 PM, Alexander Walters
<tritium-list at sdamon.com> wrote:
> '.first' also makes the default 'True', and it might just be me, but I don't
> like that aesthetically.

No, it is not just you.  I also struggled with that and had to specify
that first=False is encoded as 1 in the pickle format for backward
compatibility reasons.  Obviously, we cannot have a flag called
"second." [1]

For me, the obvious way to differentiate two moments in time is by
their chronological order and defaulting on an earlier time in the
face of ambiguity is usually the smart choice in real life.  (It is
better to come an hour earlier to an important meeting than an hour
later.)  A possible alternative to first=True (or is_first=True) would
be later=False (or is_later=False), but again you you ask me which
01:30 AM I want to pick - I will probably answer "the first" rather
than "not the later".

Although I will be the first to admit that I don't have the perfect
name for this flag - let's leave the naming part to the time when we
all agree on everything else.  If you don't like "first" - call it
"ltdf" (Local Time Disambiguation Flag) for now.

[1]: https://github.com/abalkin/ltdf/blob/master/README.rst#questions-and-answers


More information about the Datetime-SIG mailing list