A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-January/116054.html below:

[Python-Dev] Store timestamps as decimal.Decimal objects

[Python-Dev] Store timestamps as decimal.Decimal objects [Python-Dev] Store timestamps as decimal.Decimal objectsMark Shannon mark at hotpy.org
Tue Jan 31 23:58:48 CET 2012
Alexander Belopolsky wrote:
> On Tue, Jan 31, 2012 at 7:13 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> On Tue, 31 Jan 2012 21:11:37 +1000
>> Nick Coghlan <ncoghlan at gmail.com> wrote:
>>> Having a low-level module like os needing to know about higher-level
>>> types like decimal.Decimal and datetime.datetime (or even timedelta)
>>> should be setting off all kinds of warning bells.
>> Decimal is ideally low-level (it's a number), it's just that it has a
>> complicated high-level implementation :)
> 
> FWIW, my vote is also for Decimal and against datetime or timedelta.
> (I dream of Decimal replacing float in Python 4000, so take my vote
> with an appropriate amount of salt. :-)

Why not add a new function rather than modifying time.time()?
(after all its just a timestamp, does it really need nanosecond precision?)

For those who do want super-accuracy then add a new function
time.picotime() (it could be nanotime but why not future proof it :) )
which returns an int represent the number of picoseconds since the
epoch. ints never loose precision and never overflow.

Cheers,
Mark.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4