V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
superhxl
V2EX  ›  Python

vim+coc-pyright,如何忽略特定的语法检查?

  •  
  •   superhxl · 2021-11-14 21:52:47 +08:00 · 1472 次点击
    这是一个创建于 866 天前的主题,其中的信息可能已经有所发展或是发生改变。

    vim+coc-pyright 编写 python 程序会进行语法检查,这很方便。但对于特定库,其提示“Pyright ReportGeeneralTypeIssues”错误(如下图),但实际上并没有错误,请问如何设置能否忽略此类错误或者针对特定包( deap )忽略该错误?谢谢!

    Volekingsg
        1
    Volekingsg  
       2021-11-15 09:17:43 +08:00
    pyright 对于很多第三方包 type information 推断并不好,建议关掉 useLibraryCodeForTypes
    Volekingsg
        2
    Volekingsg  
       2021-11-15 09:20:20 +08:00
    @Volekingsg #1 另外微软他们维护了一些常见第三方包的 type stub ,pylance 自动集成了,用 pyright 的话需要手动 clone 并指定路径。见 https://github.com/microsoft/pyright/blob/main/docs/configuration.md#main-pyright-config-options https://github.com/python/typeshed
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2680 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 15:12 · PVG 23:12 · LAX 08:12 · JFK 11:12
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.