diff --git a/jedi/__init__.py b/jedi/__init__.py index 1e87dece..397aa9f4 100644 --- a/jedi/__init__.py +++ b/jedi/__init__.py @@ -16,17 +16,19 @@ To give you a simple example how you can use the Jedi library, here is an example for the autocompletion feature: >>> import jedi ->>> source = '''import json; json.l''' ->>> script = jedi.Script(source, 1, 19, 'example.py') +>>> source = ''' +... import datetime +... datetime.da''' +>>> script = jedi.Script(source, 3, len('datetime.da'), 'example.py') >>> script >>> completions = script.complete() ->>> completions -[, ] +>>> completions #doctest: +ELLIPSIS +[, , ...] >>> print(completions[0].complete) -oad +te >>> print(completions[0].word) -load +date As you see Jedi is pretty simple and allows you to concentrate on writing a good text editor, while still having very good IDE features for Python. diff --git a/jedi/api.py b/jedi/api.py index 49ff0738..e2631507 100644 --- a/jedi/api.py +++ b/jedi/api.py @@ -485,10 +485,12 @@ def _quick_complete(source): """ Convenience function to complete a source string at the end. - Example:: + Example: - >>> _quick_complete('import json\\njson.l') - [, ] + >>> _quick_complete(''' + ... import datetime + ... datetime.da''') #doctest: +ELLIPSIS + [, , ...] :param source: The source code to be completed. :type source: string