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 belopolsky
Recipients amaury.forgeotdarc, belopolsky, brett.cannon, catlee, erik.stephens, guettli, jribbens, lemburg, skip.montanaro, steve.roberts, tim.peters, tomster, vstinner
Date 2008-11-14.15:18:22
SpamBayes Score 3.7196318e-10
Marked as misclassified No
Message-id <>
In-reply-to <>
I was going to say the same as Amaury: timedelta / timedelta is
dimensionless (time units cancel each other in division) and the
advantage of this notation is that you get a way to express
timedelta.toxxx for all units accepted in constructor and even toweeks
becomes simple d / timedelta(7).

I've started flashing out a patch and then recalled that I've seen one
at issue2706 .  So instead of attaching a new patch here, I am going
to review the one in issue2706 now.

There was also some related discussion at issue4291 .   Apparently it
has been suggested that timedelta to integer and float conversions
would be a better alternative to timedelta / timedelta division.   I
disagree.  Integer conversion is ambiguous - should it be to seconds,
to microseconds or to timedelta.resolution (whatever that will become
in the future)?  Floating point conversion may loose precision as Tim
pointed out in msg26266 .  That would lead users to scratching their
heads over what to use float(d1)/float(d2) or float(d1)/int(d2) or
even int(d1)/int(d2) with true division on.

This said, let's move this discussion to issue2706 now.

On Fri, Nov 14, 2008 at 7:17 AM, Amaury Forgeot d'Arc
<> wrote:
> Amaury Forgeot d'Arc <> added the comment:
>> timedelta / timedelta -> seconds? days? nanoseconds?
> The quotient of two timedelta is a dimensionless number with no unit:
>    timedelta(hours=1) / timedelta(minutes=5) == 12.0
> This seems well defined, where is the ambiguity?
> ----------
> nosy: +amaury.forgeotdarc
> _______________________________________
> Python tracker <>
> <>
> _______________________________________
Date User Action Args
2008-11-14 15:18:26belopolskysetrecipients: + belopolsky, lemburg, tim.peters, skip.montanaro, brett.cannon, jribbens, guettli, amaury.forgeotdarc, catlee, vstinner, tomster, erik.stephens, steve.roberts
2008-11-14 15:18:25belopolskylinkissue1673409 messages
2008-11-14 15:18:22belopolskycreate