[Python-ideas] datetime.timedelta literals

Chris Barker chris.barker at noaa.gov
Mon Jun 4 19:22:43 EDT 2018


On Mon, Jun 4, 2018 at 3:21 PM, Paul Moore <p.f.moore at gmail.com> wrote:

> > So maybe you could propose adding:
> >
> > seconds
> > minutes
> > hours
> > days
> >
> > to the datetime module, and then we could write:
> >
> > 60*seconds == 1*minutes
> >
> > Without any changes to the language at all.
>
> This strikes me as more of a personal/team style issue, so probably
> fits better as local definitions in a project's "utilities" module.
>

probably, yes -- that's why I'm not going to push for it. But the point is
that we can "solve" this problem in Python by:

* Doing nothing, and letting people roll their own simiple solution

or

* Adding a few names to the datetime module

Which is a pretty small lift, at least compared to adding new literal
syntax.

-CHB


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180604/45318c3c/attachment-0001.html>


More information about the Python-ideas mailing list