Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] PEP: New timestamp formats

Victor Stinnervictor.stinner at haypocalc.com
Thu Feb 2 14:10:14 CET 2012


> Even if I like the idea, I don't think that we need all this machinery> to support nanosecond resolution. I should maybe forget my idea of> using datetime.datetime or datetime.timedelta, or only only support> int, float and decimal.Decimal.I updated my patch (issue #13882) to only support int, float anddecimal.Decimal types. I suppose that it is just enough.Only adding decimal.Decimal type avoids many questions: - which API / protocol should be used to support other types - what is the start of a timestamp? - etc.As we seen: using time.time(timestamp=type) API, it will be easy tosupport new types later (using a new protocol, a registry like Unicodecodecs, or anything else).Let's start with decimal.Decimal and support it correctly (e.g. patchdatetime.datetime.fromtimestamp() and os.*utime*() functions).Victor


More information about the Python-Devmailing list

[8]ページ先頭

©2009-2025 Movatter.jp