在将列(int)转换为int时,Pyright显示出错误
我不能不添加#类型而分配一个变量:忽略||用于Pyright(AutoComplete)
或它给我一个错误。 错误:[pyright reportgeneraltypeissues] [e]类型“列”的参数无法分配给function“ in function” in function“ ___init__”                 /代码> (我使用Sqlalchemy BTW)
I can not assign a variable without adding # type:ignore || Used for pyright (Autocomplete)
or it giving me an error.
Error: [Pyright reportGeneralTypeIssues] [E] Argument of type "Column" cannot be assigned to parameter "id" of type "int" in function "__init__" "Column" is incompatible with "int"
(Im using SQLAlchemy btw)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我安装了PIP软件包
sqlalchemy-stubs
对此有所帮助。https://github.com/dropbox/sqlalchemy-stubs
I installed the pip package
sqlalchemy-stubs
which helped with this.https://github.com/dropbox/sqlalchemy-stubs
当您的扩展程序与程序中的某些变量类型无法正常工作时,您可以使用
#type:imploore
。它只能在其范围内起作用,因此...
相反...
仅在其范围内工作,
#type:imploore
如果放入该程序的第一行在 global 范围中。When your extension doesn't work fine with some variable types in the program, you can use
# type: ignore
.It will work only in its scope, so...
Instead...
Working only in its scope,
# type: ignore
will have effect on the entire script if put in the first lines of the program, in the global scope.