mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-18 19:45:57 +08:00
Fix some doctests that were slightly changed because of stubs
This commit is contained in:
@@ -19,18 +19,18 @@ example for the autocompletion feature:
|
|||||||
|
|
||||||
>>> import jedi
|
>>> import jedi
|
||||||
>>> source = '''
|
>>> source = '''
|
||||||
... import datetime
|
... import json
|
||||||
... datetime.da'''
|
... json.lo'''
|
||||||
>>> script = jedi.Script(source, 3, len('datetime.da'), 'example.py')
|
>>> script = jedi.Script(source, 3, len('json.lo'), 'example.py')
|
||||||
>>> script
|
>>> script
|
||||||
<Script: 'example.py' ...>
|
<Script: 'example.py' ...>
|
||||||
>>> completions = script.completions()
|
>>> completions = script.completions()
|
||||||
>>> completions #doctest: +ELLIPSIS
|
>>> completions
|
||||||
[<Completion: date>, <Completion: datetime>, ...]
|
[<Completion: load>, <Completion: loads>]
|
||||||
>>> print(completions[0].complete)
|
>>> print(completions[0].complete)
|
||||||
te
|
ad
|
||||||
>>> print(completions[0].name)
|
>>> print(completions[0].name)
|
||||||
date
|
load
|
||||||
|
|
||||||
As you see Jedi is pretty simple and allows you to concentrate on writing a
|
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.
|
good text editor, while still having very good IDE features for Python.
|
||||||
|
|||||||
@@ -521,8 +521,8 @@ def get_global_filters(evaluator, context, until_position, origin_scope):
|
|||||||
Finally, it yields the builtin filter, if `include_builtin` is
|
Finally, it yields the builtin filter, if `include_builtin` is
|
||||||
true (default).
|
true (default).
|
||||||
|
|
||||||
>>> filters[3].values() #doctest: +ELLIPSIS
|
>>> list(filters[3].values()) #doctest: +ELLIPSIS
|
||||||
[<CompiledName: ...>, ...]
|
[CompiledStubName(...>, ...]
|
||||||
"""
|
"""
|
||||||
from jedi.evaluate.context.function import FunctionExecutionContext
|
from jedi.evaluate.context.function import FunctionExecutionContext
|
||||||
while context is not None:
|
while context is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user