[Datetime-SIG] pytz vs. PEP 495 Was: PEP-431/495

Alexander Belopolsky alexander.belopolsky at gmail.com
Tue Aug 25 00:18:23 CEST 2015


On Mon, Aug 24, 2015 at 5:58 PM, Ethan Furman <ethan at stoneleaf.us> wrote:

>     try:
>          some_date = get_a_datetime_from_somewhere(ltdf=None)
>     except AmbiguousTimeError, NonExistentTimeError as e:
>          log(weird_time_error, e)
>          some_date = use_default(e.datetime)
>
> ..
> Writing functions to work around short-comings is not how I like to spend
> my time (see my contention above about library code).
>

Neither do I.  That's why in my code you are more likely to see

some_date = get_a_datetime_from_somewhere()

instead of the wall of text that you presented.  As you can imagine, I will
not be happy facing a prospect of adding try:.. except's everywhere to port
my code to Python 3.6.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150824/b7d12bce/attachment.html>


More information about the Datetime-SIG mailing list