[Python-Dev] Issue 2736: datetimes and Unix timestamps
Nick Coghlan
ncoghlan at gmail.com
Mon Jun 4 14:11:04 CEST 2012
On Mon, Jun 4, 2012 at 9:19 PM, Dirkjan Ochtman <dirkjan at ochtman.nl> wrote:
> Anyway, I was pointed to issue 2736, which seems to have got a lot of
> discouraged core contributors (Victor, Antoine, David and Ka-Ping, to
> name just a few) up against Alexander (the datetime maintainer,
> AFAIK). It seems like a fairly straightforward case of practicality
> over purity: Alexander argues that there are "easy" one-liners to do
> things like datetime.totimestamp(), but most other people seem to not
> find them so easy. They've since been added to the documentation at
> least, but I would like to see if there is consensus on python-dev
> that adding a little more timestamp support to datetime objects would
> make sense.
>
> I hope this won't become another epic issue like the last time-related issue...
My perspective is that if I'm dealing with strictly absolute time, I
should only need one import: datetime
If I'm dealing strictly with relative time, I should also only need
one import: time
I shouldn't need to import any other modules to convert betwen them
and, since datetime is the higher level of the two, that's where the
responsibility for handling any conversions should lie.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev
mailing list