Message75725
| Author |
vstinner |
| Recipients |
brett.cannon, skip.montanaro, vstinner |
| Date |
2008年11月11日.03:22:56 |
| SpamBayes Score |
4.851084e-06 |
| Marked as misclassified |
No |
| Message-id |
<1226373778.08.0.370558335076.issue1083@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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.1000000000000001
>> timedelta(microseconds=20) / 1
...
TypeError: unsupported operand type(s) for /: ...
Now in the real world, it's hard to understand that the operator //
should be used instead of /. So timedelta()/int might be an alias to
timedelta()//int. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2008年11月11日 03:22:58 | vstinner | set | recipients:
+ vstinner, skip.montanaro, brett.cannon |
| 2008年11月11日 03:22:58 | vstinner | set | messageid: <1226373778.08.0.370558335076.issue1083@psf.upfronthosting.co.za> |
| 2008年11月11日 03:22:57 | vstinner | link | issue1083 messages |
| 2008年11月11日 03:22:56 | vstinner | create |
|