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
find456789
V2EX  ›  Python

写 Python 代码的时候,在 type hints 、mypy、pyright 应该选择哪一个呢?

  •  
  •   find456789 ·
    find456789 · 2019-04-03 15:35:03 +08:00 · 1833 次点击
    这是一个创建于 1822 天前的主题,其中的信息可能已经有所发展或是发生改变。

    目前个人倾向 选择官方的 type hints

    这 3 个东西都可以让 python 代码变得健壮

    选择哪一个 最好呢? 理由是什么呢?

    谢谢

    4 条回复    2019-04-28 23:26:52 +08:00
    aoe2ex
        1
    aoe2ex  
       2019-04-03 16:37:58 +08:00
    pyright
    find456789
        2
    find456789  
    OP
       2019-04-03 16:49:22 +08:00
    @aoe2ex 谢谢, 我再研究研究
    Trim21
        3
    Trim21  
       2019-04-03 16:51:57 +08:00
    第一次听说 pyright 想看看, 发现是用 npm 安装的, 有毒啊...
    srlp
        4
    srlp  
       2019-04-28 23:26:52 +08:00 via iPhone   ❤️ 1
    mypy 是兼容官方的 type hint 的 linter,配置使用这个即可。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5360 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 07:59 · PVG 15:59 · LAX 00:59 · JFK 03:59
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.