dash.dash.dash和Dash.dash之间的区别?

发布于 2025-02-05 18:17:40 字数 353 浏览 1 评论 0原文

我正在用旧的存储库修复一些代码,需要进行一些(mypy)测试。 Mypy似乎无法识别dash.dash呼叫,投掷以下内容:错误:模块没有属性“ dash”

我发现的一个简单的修复程序是使用dash.dash.dash,它似乎是等效的,因为它们具有相同的源文件。我想知道:

  1. 它们等效吗?如果是,为什么两者都有?如果没有什么是另一个解决方案?
  2. 为什么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:

  1. Are they equivalent? If yes why have both? If no what is another solution?
  2. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文