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

大佬们写 Python 的时候是怎么提高写代码的效率的

  •  
  •   AdamLee · Aug 31, 2018 · 2504 views
    This topic created in 2822 days ago, the information mentioned may be changed or developed.
    如题,本人刚开始学 python,我之前写 java,这种强类型语言在 ide 中的代码提示很便捷,就算不了解某个类中的具体方法或属性,通过打其中的关键字就能从代码联想列表中找到自己想要的方法,比如要获取某个类中的列表数据,一般方法命名为 getXXX,那我直接打 get 就能联想出来,但是 Python 中如果是从方法形参中想要去调用它的方法只能自己打全部的方法名,这效率有点低,而且方法中的参数类型也需要去注意。
    我知道 python 不声明类型是它简洁语言的特性之一,但是对于自己不熟悉的代码,在调用的时候很不方便,各位有经验的 python 大佬有什么建议的吗
    3 replies    2018-09-08 15:36:53 +08:00
    huangzhe8263
        1
    huangzhe8263  
       Sep 1, 2018 via Android
    自动补全的意思?
    用 pycharm
    然后 3.5 以上用 type hint
    以下用 ide 的 docstring
    AdamLee
        2
    AdamLee  
    OP
       Sep 7, 2018
    @huangzhe8263 谢谢指导,但是对于一些系统的方法或者一些框架(比如我最近在学习的 Django )调用其内的方法(它们并没有标明 type ),很多参数提示都是*args,**kwargs,我该怎么知道到底传什么呢。
    huangzhe8263
        3
    huangzhe8263  
       Sep 8, 2018
    @AdamLee #2
    哦哦你说第三方库呀, 这种就看文档吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2854 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 05:06 · PVG 13:06 · LAX 22:06 · JFK 01:06
    ♥ Do have faith in what you're doing.