[issue1083] Confusing error message when dividing timedelta using /

2010-06-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Closing as duplicate of issue1289118. Division of timedelta by integer is supported in py3k since r81625. -- nosy: +belopolsky -Alexander.Belopolsky resolution: -> duplicate status: open -> closed superseder: -> timedelta multiply and divide b

[issue1083] Confusing error message when dividing timedelta using /

2010-05-20 Thread Skip Montanaro
Changes by Skip Montanaro : -- nosy: -skip.montanaro ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue1083] Confusing error message when dividing timedelta using /

2010-04-20 Thread Skip Montanaro
Skip Montanaro added the comment: Mark> I think it's fine to do the division and round the result to the Mark> nearest whole number of microseconds. Right. Just think of a timedelta as a floating point number of seconds with very limited precision (1e-6 seconds). -- _

[issue1083] Confusing error message when dividing timedelta using /

2010-04-20 Thread Mark Dickinson
Changes by Mark Dickinson : -- type: behavior -> feature request versions: +Python 3.2 -Python 2.7, Python 3.0 ___ Python tracker ___ _

[issue1083] Confusing error message when dividing timedelta using /

2010-04-20 Thread Mark Dickinson
Mark Dickinson added the comment: I think it's fine to do the division and round the result to the nearest whole number of microseconds. I don't see any good reason for disallowing timedelta / int (or even timedelta / float). -- nosy: +mark.dickinson

[issue1083] Confusing error message when dividing timedelta using /

2010-04-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This is certainly not a bug, so I don't think targeting 2.7 is appropriate. I have explained in a comment on issue2706 (see msg75917) why I believe true division of timedelta by int should not be supported. In short, true division of timedelta by int

[issue1083] Confusing error message when dividing timedelta using /

2010-03-31 Thread Miki Tebeka
Miki Tebeka added the comment: It's marked on 2.7 due to the following (this is svn 79528) >>> from datetime import timedelta >>> d = timedelta(1) >>> d / 2 datetime.timedelta(0, 43200) >>> d // 2 datetime.timedelta(0, 43200) >>> from __future__ import division >>> d / 2 Traceback (most recent

[issue1083] Confusing error message when dividing timedelta using /

2010-03-30 Thread Shashwat Anand
Shashwat Anand added the comment: I do not understand why python2.7 is marked in Version tag ? I reproduced the error on 3.1 but no isues on 2.7 06:39:30 l0nwlf-MBP:data $ python2.7 Python 2.7a4+ (trunk:78750, Mar 7 2010, 08:09:00) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin Type "

[issue1083] Confusing error message when dividing timedelta using /

2010-03-18 Thread Miki Tebeka
Miki Tebeka added the comment: I see the same problem when "from __future__ import division" on the 2.x series. Seem like the timedelta objects is missing the __truediv__ method. -- nosy: +tebeka versions: +Python 2.7 ___ Python tracker

[issue1083] Confusing error message when dividing timedelta using /

2008-11-20 Thread webograph
Changes by webograph <[EMAIL PROTECTED]>: -- nosy: +webograph ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing li

[issue1083] Confusing error message when dividing timedelta using /

2008-11-10 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: The current behaviour is consistent with the integer divison: >>> 21 // 10 2 >>> timedelta(microseconds=20) // 10 datetime.timedelta(0, 0, 2) Whereas int/int gives float: >>> 21 / 10 2.1001 >> timedelta(microseconds=20) / 1 ... Ty

[issue1083] Confusing error message when dividing timedelta using /

2007-11-21 Thread Christian Heimes
Changes by Christian Heimes: -- keywords: +patch Added file: http://bugs.python.org/file8792/py3k_datetime_1083.patch __ Tracker <[EMAIL PROTECTED]> __

[issue1083] Confusing error message when dividing timedelta using /

2007-09-18 Thread Sean Reifschneider
Changes by Sean Reifschneider: -- priority: -> normal __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue1083] Confusing error message when dividing timedelta using /

2007-09-13 Thread Brett Cannon
Brett Cannon added the comment: If you set nb_true_div on timedelta objects to delta_divide (just like nb_floor_div) you won't have this problem as the division will just work. Otherwise there is no other good way as if the divisor doesn't work you need to return NotImplemented, which then tries

[issue1083] Confusing error message when dividing timedelta using /

2007-09-13 Thread Brett Cannon
Changes by Brett Cannon: -- keywords: +py3k versions: +Python 3.0 __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscri

[issue1083] Confusing error message when dividing timedelta using /

2007-09-01 Thread Skip Montanaro
New submission from Skip Montanaro: I discovered the hard way today that this won't work: >>> import datetime >>> d = datetime.timedelta(1) >>> d / 2 Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for /: 'datetime.timedelta' and 'int' The error