[Python-ideas] datetime.timedelta literals
Pål Grønås Drange
paal.drange at gmail.com
Thu Jun 7 07:34:58 EDT 2018
For closure, I've added a package, timeliterals
(env) [pgdr at hostname ~]$ pip install timeliterals
(env) [pgdr at hostname ~]$ python
>>> from timeliterals import *
The source code is at https://github.com/pgdr/timeliterals
I'm not going to submit a patch to datetime at this time, but I will if
would be interested.
On 5 Jun 2018 13:56, "Jacco van Dorp" <j.van.dorp at deonet.nl> wrote:
> i'd also be pretty simple to implement....
> Just list:
> minute = timedelta(minutes=1)
> hour = timedelta(hours=1)
> and you could import and use them like that. Or if you really want to
> write 5*m, the just from datetime import minute as m
> Python-ideas mailing list
> Python-ideas at python.org
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas