[Python-ideas] intuitive timedeltas like in go

Serhiy Storchaka storchaka at gmail.com
Wed Jan 6 12:36:30 EST 2016


On 06.01.16 19:04, Sven R. Kunze wrote:
> timedelta handling always felt cumbersome to me:
>
> from datetime import timedelta
>
> short_period = timedelta(seconds=10)
> long_period = timedelta(hours=4, seconds=37)
>
> Today, I came across this one https://github.com/lxc/lxd/pull/1471/files
> and I found the creation of a 10 seconds timeout extremely intuitive.
> Would this represent a valuable addition to Python?
>
> from datetime import second, hour
>
> short period = 10*second
> long_period = 4*hour + 37*second

Does Go support keyword arguments?




More information about the Python-ideas mailing list