[Python-Dev] Store timestamps as decimal.Decimal objects (original) (raw)

Nick Coghlan ncoghlan at gmail.com
Wed Feb 1 12:26:08 CET 2012


On Wed, Feb 1, 2012 at 9:08 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:

Right, but that's not even a plausible request. Nobody wants to write a separate time module just to have a different return type.

I can definitely see someone doing "import hirestime as time" to avoid having to pass a flag everywhere, though. I don't think that should be the way we expose the functionality - I just think it's a possible end user technique we should keep in mind when assessing the alternatives.

As I said in my last reply to Victor though, I'm definitely coming around to the point of view that supporting more than just Decimal is overgeneralising to the detriment of the API design. As you say, if decimal objects were a builtin type, we wouldn't even be considering alternative high precision representations - the only discussion would be about the details of the API for requesting high resolution timestamps (and while boolean flags are ugly, I'm not sure there's anything else that will satisfy backwards compatibility constraints).

Cheers, Nick.

-- Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-Dev mailing list