intuitive timedeltas like in go
Hi, 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 Best, Sven
On Wed, Jan 6, 2016 at 10:04 AM, Sven R. Kunze <srkunze@mail.de> wrote:
Hi,
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
Anybody who wants this can already accomplish it with just a few extra lines:
from datetime import timedelta second = timedelta(seconds=1) hour = timedelta(hours=1) 10*second datetime.timedelta(0, 10) 4*hour + 37*second datetime.timedelta(0, 14437)
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?
On Wed, 6 Jan 2016 at 09:37 Serhiy Storchaka <storchaka@gmail.com> wrote:
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?
Nope: https://golang.org/ref/spec#Calls -Brett
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
participants (4)
-
Brett Cannon -
Ian Kelly -
Serhiy Storchaka -
Sven R. Kunze