[issue2706] datetime: define division timedelta/timedelta

Alexander Belopolsky report at bugs.python.org
Fri Nov 14 19:52:13 CET 2008


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

On Fri, Nov 14, 2008 at 1:28 PM, STINNER Victor <report at bugs.python.org> wrote:
..
> What do you think about:
>  timedelta / <timedelta or int or float>  # only with __future__.divison
>  timedelta // <timedelta or int>
>  timedelta % <timedelta or int>
>  divmod(timedelta, <timedelta or int>)
> with:
>  timedelta // int -> timedelta
already there

+1

+1

+1

timedelta % float -> timedelta (because int % float -> int works) ?

+1

+1

divmod(timedelta, float) -> (timedelta, timedelta) ?

-1

Only timedelta / timedelta should produce dimensionless numbers.
timedelta / <float or int> should be disallowed in true division mode.
 I am +0 on timedelta / timedelta -> float in true division mode.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2706>
_______________________________________


More information about the Python-bugs-list mailing list