homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients
Date 2005年09月15日.21:04:28
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=31435
timedelta arithmetic is 100% portable now, and wholly 
explainable in terms of universally understood integer 
arithmetic. Throw floats into it, and that's lost.
That said, I don't have a strong objection to complicating the 
implementation if there _are_ strong use cases. The OP's 
example isn't "a use case": it's not worth anything to let 
someone multiply a timedelta by 0.5 instead of dividing by 2. 
I don't have a use case to offer in its place (never felt a need 
here).
If someone wants to work on it, note that a timedelta can 
contain more than 53 bits of information, so, e.g., trying to 
represent a timedelta as an IEEE double-precision number of 
microseconds can lose information. This makes a high-
qualty "computed as if to infinite precision with one rounding 
at the end" implementation of mixed datetime/float arithmetic 
tricky to do right.
History
Date User Action Args
2007年08月23日 14:34:30adminlinkissue1289118 messages
2007年08月23日 14:34:30admincreate

AltStyle によって変換されたページ (->オリジナル) /