Django Book 翻译
菜单>:
TOC
返回
原文:
What happened? Well, the ``datetime.timedelta`` function expects the ``hours`` parameter to be an integer, and we commented out the bit of code that converted ``offset`` to an integer. That caused ``datetime.timedelta`` to raise the ``TypeError`` . Its the typical kind of small bug that every programmer runs into at some point.
翻译:
怎么回事呢?是的, ``datetime.timedelta`` 函数要求 ``hours`` 参数必须为整型, 而我们注释掉了将 ``offset`` 转为整型的代码。这样导致 ``datetime.timedelta`` 弹出 ``TypeError`` 异常。这是所有程序员某个时候都可能碰到的一种典型错误。
备注:
译者: