On Mon, Dec 21, 2015 at 9:02 AM, Alexander Belopolsky <alexander.belopol...@gmail.com> wrote: > On Fri, Dec 18, 2015 at 4:09 PM, Guido van Rossum <gu...@python.org> wrote: >>> >>> >>> It's 11 days. Which is pretty reasonable server uptime. >> >> >> Oops, blame the repr() of datetime.timedelta. I'm sorry I so rashly >> thought I could do better than the OP. > > > 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) Would there be value in changing the repr to use keyword arguments? Positional arguments might well not correspond to the way they were created, and unless you happen to know what the fields mean, they're a little obscure: >>> datetime.timedelta(weeks=52,minutes=1488) datetime.timedelta(365, 2880) Worse, help(datetime.timedelta) in 3.6 doesn't document the constructor at all. There's no mention of __init__ at all, __new__ has this useless information: | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. and aside from there being three data descriptors, there's nothing to suggest that you construct these things with timedelta(days, seconds, microseconds). Definitely no indication that you can use other keyword args. Is this something worth fixing, or is it acceptable to drive people to fuller documentation than help()? ChrisA _______________________________________________ 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