[Python-Dev] PEP: New timestamp formats (original) (raw)
Jeffrey Yasskin jyasskin at gmail.com
Fri Feb 3 20:04:14 CET 2012
- Previous message: [Python-Dev] PEP: New timestamp formats
- Next message: [Python-Dev] PEP: New timestamp formats
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Feb 2, 2012 at 4:59 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
datetime.datetime
- real problem with the idea is that not all timestamps can be easily made absolute (e.g. some APIs may return "time since system started" or "time since process started")
I think this is an argument for returning the appropriate one of datetime or timedelta from all of these functions: users need to keep track of whether they've got an absolute time, or an offset from an unspecified starting point, and that's a type-like distinction.
- the complexity argument used against timedelta also applies
A plain number of seconds is superficially simpler, but it forces more complexity onto the user, who has to track what that number represents.
datetime and timedelta are even available from a C module, which I had expected to be a blocking issue.
The biggest problem I see with using datetime and timedelta for everything is that switching to them is very backwards-incompatible.
Jeffrey
- Previous message: [Python-Dev] PEP: New timestamp formats
- Next message: [Python-Dev] PEP: New timestamp formats
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]