Jedi

  • Autocompletion library for Python
  • Embeddable in your editor / IDE / debugger
  • Plugins for Vim, Emacs, Sublime Text 2/3

  • Runs on Python 2.6+ and 3.2+
  • Understands Python 2 and 3

  • LGPL
  • Good docs
  • Tests with 94% coverage

  • It's quite good

Vim Example



General Features

  • Can deal with complex structures
  • Handles syntax errors and wrong indentation
  • Support for Virtualenv
  • Type hinting with Sphinx and Epydoc docstrings
  • Easily embeddable

Supported Python Features

  • Builtins
  • Multiple returns / yields
  • Indexing (lists, dictionaries)
  • Exceptions
  • Absolute / relative / star imports
  • Context managers
  • *args / **kwargs
  • Decorators / lambdas / closures
  • Generators / iterators
  • Some descriptors
  • Some magic methods
  • List manipulation
  • Function annotations
  • Simple sys.path modifications
  • ...and more

Unsupported Python Features

  • Metaclasses
  • setattr()
  • __import__()
  • Writing to globals(), locals(), object.__dict__
  • Evaluating if / while

Example 1


a = set([1,2,3,4])
a.add('bacon')
b = list(a)[0]
b.# <tab>

Example 2

(Warning: This ugly code is not for the faint of heart...)

import json

class Spam(object):
    global json
    ham = json
def spamify():
    return Spam 
bacon = getattr(spamify()(), 'ham')
print bacon.# <tab>

When Jedi Fails...

  • "Jedi Mixins" can be written
  • Python "mock implementation" of real library
  • Mostly used for binary imports, e.g. SQLite3

In The Wild...

Jedi can currently be used with:

In The Future Wild...

Jedi is being integrated into:

Join Us! Embed Or Use Jedi!







Thanks for your attention!

Danilo Bargen
twitter.com/dbrgn

Jedi Lightning Talk

By Danilo Bargen

Jedi Lightning Talk

Lightning talk about Jedi for EuroPython 2013 (presented on 2013-07-05).

  • 3,026