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 Alexander.Belopolsky
Recipients Alexander.Belopolsky, agthorr, mcherm, rhettinger, skip.montanaro, tim.peters, vstinner
Date 2010-04-20.21:04:54
SpamBayes Score 2.1010971e-13
Marked as misclassified No
Message-id <1271797496.55.0.851595612792.issue1289118@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-04-20 21:04:56Alexander.Belopolskysetrecipients: + Alexander.Belopolsky, tim.peters, skip.montanaro, mcherm, rhettinger, agthorr, vstinner
2010-04-20 21:04:56Alexander.Belopolskysetmessageid: <1271797496.55.0.851595612792.issue1289118@psf.upfronthosting.co.za>
2010-04-20 21:04:55Alexander.Belopolskylinkissue1289118 messages
2010-04-20 21:04:54Alexander.Belopolskycreate