Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment:

This is in a way more similar to issue1083 than to issue2706.  I am -1 on this 
RFE for the same reason as I am opposing allowing true division of timedelta by 
an int.  The timedelta type is fundamentally an integer type.  A type delta is 
just a certain number of microseconds.  A timedelta divided by a number or 
multiplied by a float is logically a fractional number of microseconds and 
python does not have a type to represent it.

Daniel's use case of passing timedeltas to a statistical packages is neatly 
addressed by issue2706's timedelta / timedelta (true) division.  Just strip the 
dimensionality from your data by dividing each time delta by a chosen unit 
interval (depending on the problem, a second, a microsecond or even a day may 
be appropriate).  The result will be a set of floats that your number crunching 
package will be happy to process.

Another advantage of this approach is that floats can be processed more 
efficiently than timedeltas with FP arithmetics and intermediate results will 
be more accurate in most cases.

I recommend accepting issue2706 and rejecting this issue together with 
issue2706.

----------
nosy: +Alexander.Belopolsky
type:  -> feature request
versions: +Python 3.3 -Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1289118>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to