推荐学习书目
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
cbiqih
V2EX  ›  Python

发现个 Pycharm 的代码模板不提示的 bug~

  •  
  •   cbiqih · Feb 5, 2021 · 3022 views
    This topic created in 1936 days ago, the information mentioned may be changed or developed.

    平时会输入 main + tab 键 来生成 if __name__ == '__main__':

    但最近发现输入 main 后没有提示了,但又不是所有文件都不提示

    对比了几个文件后总结为:

    • 如果准备输入位置上方使用了 ... 来做占位符时,输入就没有提示了
    • 如果准备输入位置上方使用了 pass 来做占位符,就能正常提示哇~

    当前使用的版本是 PyCharm 2020.3.2,不知道其他版本是否能重现.

    顺道问下大家喜欢使用哪种来做 空代码占位符 呢?

    7 replies    2021-02-06 13:44:49 +08:00
    aladdindingding
        1
    aladdindingding  
       Feb 5, 2021
    Pycharm 从来没出现过,倒是 vscode 经常么有提示
    learningman
        2
    learningman  
       Feb 5, 2021
    ...是伊普西隆吗
    Yourshell
        3
    Yourshell  
       Feb 5, 2021
    用 `...` 作为占位符是什么新语法吗?语法错了无法识别那么自然就不能智能提示了吧。
    djj510620510
        4
    djj510620510  
       Feb 5, 2021
    占位不是应该用# TODO 吗
    cbiqih
        5
    cbiqih  
    OP
       Feb 5, 2021   ❤️ 1
    @Yourshell
    >>> type(...)
    <class 'ellipsis'>
    AoEiuV020
        6
    AoEiuV020  
       Feb 6, 2021   ❤️ 1
    搜了下早就有人提了,一直没解决,这可能是 feature 不是 bug 吧,
    https://youtrack.jetbrains.com/issue/PY-25499
    wbyyffhh
        7
    wbyyffhh  
       Feb 6, 2021
    今天学到了...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   983 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 22:12 · PVG 06:12 · LAX 15:12 · JFK 18:12
    ♥ Do have faith in what you're doing.