Emacs - tab-completion of local Python variables

前端 未结 6 1725
失恋的感觉
失恋的感觉 2020-12-04 12:31

Is there a good emacs mode that will allow tab-completion of local python variables? I set up ipython.el but it will only tab-complete things in the scope of the interpreter

6条回答
  •  心在旅途
    2020-12-04 13:11

    Use Jedi!

    It really understands Python better than any other autocompletion library:

    • builtins
    • multiple returns or yields
    • tuple assignments / array indexing / dictionary indexing
    • with-statement / exception handling
    • *args / **kwargs
    • decorators / lambdas / closures
    • generators / iterators
    • some descriptors: property / staticmethod / classmethod
    • some magic methods: __call__, __iter__, __next__, __get__, __getitem__, __init__
    • list.append(), set.add(), list.extend(), etc.
    • (nested) list comprehensions / ternary expressions
    • relative imports
    • getattr() / __getattr__ / __getattribute__
    • simple/usual sys.path modifications
    • isinstance checks for if/while/assert

提交回复
热议问题