>>> datetime.timedelta(1<<30)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.4/datetime.py", line 430, in __new__
raise OverflowError("timedelta # of days is too large: %d" % d)
OverflowError: timedelta # of days is too large: 1073741824
C加速版本(
_datetime
)是在datetime.py
中使用from _datetime import *
启用的,因此如果datetime模块已在前面导入,则足以导致ImportError并重新加载该模块:测试:
回溯显示使用了纯Python版本。你知道吗
相关问题 更多 >
编程相关推荐