[Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

Barry Warsaw barry at python.org
Tue Feb 14 23:29:20 CET 2012


I think I will just state my reasoning one last time and then leave it to the
BDFL or BDFOP to make the final decision.

Victor on IRC says that there is not much difference between Decimal and
timedelta, and this may be true from an implementation point of view.  From a
cognitive point of view, I think they're miles apart.  Ultimately, I wish ints
and floats weren't used for time-y things, and only datetimes (for values with
well-defined starting points, including the epoch) and timedeltas (for values
with no starting point) were used.

We obviously can't eliminate the APIs that return and accept ints and floats,
most of which we inherited from C, but we can avoid making it worse by
extended them to also accept Decimals.  I think it would be valuable work to
correct any deficiencies in datetimes and timedeltas so that they can be used
in all time-y APIs, with whatever resolution is necessary.

My primary concern with the PEP is adding to users confusion when they have to
handle (at least) 5 different types[*] that represent time in Python.

Cheers,
-Barry

[*] int, float, Decimal, datetime, timedelta; are there others?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120214/606b4635/attachment.pgp>


More information about the Python-Dev mailing list