[Python-ideas] Date/time literals

Mark Dickinson dickinsm at gmail.com
Tue Jun 1 18:28:32 CEST 2010


On Tue, Jun 1, 2010 at 5:07 PM, Guido van Rossum <guido at python.org> wrote:
> What's the use case for these relaxations in argument range checking?
> I'd say they are more confusing, since they might lead one to suspect
> that leap seconds are in fact supported.

For the first, it would prevent tuples corresponding to valid UTC
times (or local times) causing an exception in the datetime
constructor.  I don't have any specific use-cases, but it's not hard
to imagine passing a tuple from some external UTC-supporting source to
datetime.datetime.

The second relaxation (allowing 24:00:00) comes from ISO 8601, but I
don't really know how widespread its use is.  I admit I don't find
this one particularly convincing;  perhaps Masklinn can expand on why
it's useful.

Mark



More information about the Python-ideas mailing list