dash.dash.dash和Dash.dash之间的区别?
我正在用旧的存储库修复一些代码,需要进行一些(mypy)测试。 Mypy似乎无法识别dash.dash
呼叫,投掷以下内容:错误:模块没有属性“ dash”
。
我发现的一个简单的修复程序是使用dash.dash.dash
,它似乎是等效的,因为它们具有相同的源文件。我想知道:
- 它们等效吗?如果是,为什么两者都有?如果没有什么是另一个解决方案?
- 为什么Mypy丢这个错误?
抱歉,如果很明显 - 我从未使用过Dash,我只是在修复别人的代码。我的Python,Mypy和Dash版本分别为3.8、0.812和1.21.0。
I'm fixing up some code in an old repo and I need to get some (mypy) tests passing. Mypy doesn't seem to recognise dash.Dash
calls, throwing the following: error: Module has no attribute "Dash"
.
A simple fix I've found is to use dash.dash.Dash
which seems to be equivalent as they have the same source file. I was wondering:
- Are they equivalent? If yes why have both? If no what is another solution?
- Why does mypy throw this error?
Apologies if it is obvious - I've never used Dash I'm merely fixing someone else's code. My Python, Mypy and Dash versions are 3.8, 0.812 and 1.21.0 respectively.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论