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 | skip.montanaro |
|---|---|
| Recipients | skip.montanaro |
| Date | 2007年09月01日.19:19:33 |
| SpamBayes Score | 0.31208885 |
| Marked as misclassified | No |
| Message-id | <1188674374.08.0.925919990107.issue1083@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
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 "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for /: 'datetime.timedelta' and 'int' The error message is misleading, because in fact timedelta objects *do* support division by ints, just not with the / operator: >>> d // 2 datetime.timedelta(0, 43200) Is there some way the error message can be improved, perhaps by identifying the denominator as effectively a float? |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2007年09月01日 19:19:34 | skip.montanaro | set | spambayes_score: 0.312089 -> 0.31208885 recipients: + skip.montanaro |
| 2007年09月01日 19:19:34 | skip.montanaro | set | spambayes_score: 0.312089 -> 0.312089 messageid: <1188674374.08.0.925919990107.issue1083@psf.upfronthosting.co.za> |
| 2007年09月01日 19:19:34 | skip.montanaro | link | issue1083 messages |
| 2007年09月01日 19:19:33 | skip.montanaro | create | |