[Datetime-SIG] Adding PEP 495 support to dateutil

Tim Peters tim.peters at gmail.com
Sat Sep 19 05:25:29 CEST 2015


[Akira Li <4kir4.1i at gmail.com>]
> ...
> To be clear, it is not a suggestion to change anything in stdlib. It was
> a reaction to the earlier message in this thread, to point out why
> stdlib's fromutc() API is not the example that should be followed. Thank
> you for providing the explicit reasons for the specific choices in the
> API design: "redundency helps" and fromutc() is semi-private. I can't
> remember when I've used fromutc() directly (It is used indirectly via
> datetime.now(tz), datetime.fromtimestamp(ts, tz), d.astimezone(tz),

Which are part of Python.

> tz.normalize()).

Which is unique to pytz.

So, yes, it's used as intended, by _implementations_ of higher-level
methods.  In those contexts, "convenience" is of no importance, but
the value of catching errors (by implementers!) is of supreme
importance.


More information about the Datetime-SIG mailing list