Mypy抱怨DateTime差异
Mypy抱怨分配了两个数据的差异的代码行。
foo的类型是dateTime.timedelta。
来自Mypy的错误消息是“ int不可召唤”。
我想念什么?
import arrow
t1 = arrow.now()
t2 = arrow.now()
foo = t1 - t2
bar = foo.total_seconds()
MyPy complains about the line of code where bar is assigned the difference of two datetimes.
The type of foo is datetime.timedelta.
The error message from MyPy is "int not callable".
What am I missing?
import arrow
t1 = arrow.now()
t2 = arrow.now()
foo = t1 - t2
bar = foo.total_seconds()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明这是一个已知的问题。有关详细信息,请参见以下内容:
https://github.com/python/mypy/mypy/11613131613
This turned out to be a known issue. For details, see the following:
https://github.com/python/mypy/issues/11613