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

又被 Python 尾逗号创建 tuple 坑了一次

  •  
  •   guyskk0x0 ·
    guyskk · 2020-05-11 22:09:40 +08:00 · 3139 次点击
    这是一个创建于 1417 天前的主题,其中的信息可能已经有所发展或是发生改变。
    10 条回复    2020-05-12 09:31:07 +08:00
    ClericPy
        1
    ClericPy  
       2020-05-11 22:15:32 +08:00
    五年前犯过, 后来就再也没犯过... 再后来 typing hints 一大片通红...
    guyskk0x0
        2
    guyskk0x0  
    OP
       2020-05-11 22:20:48 +08:00
    @ClericPy type hints 也不错,只是代码要完全合格有些麻烦
    frostming
        3
    frostming  
       2020-05-11 22:21:37 +08:00
    我给 pycodestyle ( flake8 使用的规则库)也提了 issue https://github.com/PyCQA/pycodestyle/issues/857
    但好像不打算修的样子
    guyskk0x0
        4
    guyskk0x0  
    OP
       2020-05-11 22:26:41 +08:00
    @frostming 先点个 👍
    ClericPy
        5
    ClericPy  
       2020-05-11 22:27:34 +08:00
    @guyskk0x0 #2

    完全合格太难了... 最后在 mypy 里排除了一大些...

    "python.linting.mypyArgs": [
    "--ignore-missing-imports",
    "--follow-imports=silent",
    "--show-column-numbers",
    "--no-strict-optional",
    ],

    捂脸, 强迫症看不得满江红, 所以自戳双眼就看不见了
    RedisMasterNode
        6
    RedisMasterNode  
       2020-05-11 22:32:06 +08:00 via Android
    @ClericPy 为什么要 ignore missing imports...
    guyskk0x0
        7
    guyskk0x0  
    OP
       2020-05-11 22:33:00 +08:00
    @ClericPy 同感。我刚开启 pylint,发现一大片五颜六色... 这好像就是我没用 pylint 和 mypy 的原因
    ClericPy
        8
    ClericPy  
       2020-05-11 22:46:03 +08:00   ❤️ 1
    @RedisMasterNode #6 还真想不起来了... 似乎是有些 debug 环境以及有些库里面用的是 from .tasks import * 导致全屏飘红, 我用的 VSCODE 开了 Error Lens, 那红的吓人

    @guyskk0x0 #7 暂时用的 flake8, 内置库里面 asyncio.__init__.py 里上来就是一句 # flake8: noqa, 我给它去掉可以参考下有多红...

    https://i.loli.net/2020/05/11/juAQVL9HGXMY35q.png

    ![R@_8_C1_1@LS4V_U8_Q5192.png]( https://i.loli.net/2020/05/11/juAQVL9HGXMY35q.png)
    Trim21
        9
    Trim21  
       2020-05-11 22:50:04 +08:00   ❤️ 2
    原来我写的这个小玩艺除了我自己还有人用...
    frostming
        10
    frostming  
       2020-05-12 09:31:07 +08:00
    pylint 太啰嗦了,我基本只用 flake8,然而 Flake8 也不修这个

    @Trim21 发现你也在我提的 issue 里面出现了,圈子太小了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5293 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:56 · PVG 13:56 · LAX 22:56 · JFK 01:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.