On Sun, Dec 20, 2015 at 5:28 PM, Chris Angelico <ros...@gmail.com> wrote:

> > A helpful trivia: a year is approximately π times 10 million seconds.
>
> Sadly doesn't help here, as the timedelta for a number of years looks like
> this:
>
> >>> datetime.timedelta(days=365*11)
> datetime.timedelta(4015)
>
>
The original issue was how long is a million seconds.  The bit of trivia
that I suggested helps to establish that it cannot be a multiple of years.


> Would there be value in changing the repr to use keyword arguments?
>

I don't think translating from seconds to years will be any simpler with
any alternative  repr, but I would really like to see a change in the repr
of negative timedeltas:

>>> timedelta(minutes=-1)
datetime.timedelta(-1, 86340)

And str() is not much better:

>>> print(timedelta(minutes=-1))
-1 day, 23:59:00

The above does not qualify as a human readable representation IMO.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to