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

官方的 mypy 到现在还没支持 3.10 新特性吗?现在版本是 0.92, 一更新后所有的 match 就报错了

  •  
  •   ChrisFreeMan · 2021-12-19 13:09:11 +08:00 · 2503 次点击
    这是一个创建于 831 天前的主题,其中的信息可能已经有所发展或是发生改变。
    9 条回复    2021-12-19 22:11:31 +08:00
    abersheeran
        1
    abersheeran  
       2021-12-19 15:05:43 +08:00
    mypy 对我来说,只剩下编译功能了,零成本提高 30% 左右的性能还是挺香的。真类型检查还得是 pylance/pyright 。
    cmdOptionKana
        2
    cmdOptionKana  
       2021-12-19 16:00:22 +08:00
    pylance 用 basic 比较舒服。
    ChrisFreeMan
        3
    ChrisFreeMan  
    OP
       2021-12-19 16:29:34 +08:00 via iPhone
    @abersheeran 啊🤔居然有编译提升性能的功能吗?我一直作为类型检查工具配合我的编辑器环境来使用的。我扫了下文档没找到啊
    janxin
        4
    janxin  
       2021-12-19 18:04:13 +08:00
    ChrisFreeMan
        6
    ChrisFreeMan  
    OP
       2021-12-19 20:02:51 +08:00
    @janxin
    @abersheeran 谢了,我稍微了解下
    ChrisFreeMan
        7
    ChrisFreeMan  
    OP
       2021-12-19 20:04:08 +08:00
    @cmdOptionKana 比较保守,看了下 python 官方自己有,而且 star 高,就用这个了
    abersheeran
        8
    abersheeran  
       2021-12-19 22:10:39 +08:00
    @ChrisFreeMan 我不是别的意思啊,Guido 懂个屁的类型系统,mypy 至今不支持递归类型,连个 Jsonable Type 都描述不了,以及 SelfType 被多次驳回。真要用静态类型的脚本语言,还是试试 TypeScript 吧。
    abersheeran
        9
    abersheeran  
       2021-12-19 22:11:31 +08:00
    总之我的意思是,pyright/pylance 要比 MyPy 好。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2736 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 15:07 · PVG 23:07 · LAX 08:07 · JFK 11:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.