mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
Don't go crazy with big lists.
This commit is contained in:
@@ -207,6 +207,9 @@ class CompiledObject(Context):
|
||||
return
|
||||
|
||||
for i, part in enumerate(self.obj):
|
||||
if i > 20:
|
||||
# Should not go crazy with large iterators
|
||||
break
|
||||
yield LazyKnownContext(create(self.evaluator, part))
|
||||
|
||||
def py__name__(self):
|
||||
|
||||
@@ -218,3 +218,10 @@ def test_param_completion():
|
||||
_assert_interpreter_complete('foo(bar', locals(), ['bar'])
|
||||
# TODO we're not yet using the Python3.5 inspect.signature, yet.
|
||||
assert not jedi.Interpreter('lambd(xyz', [locals()]).completions()
|
||||
|
||||
|
||||
def test_endless_yield():
|
||||
lst = [1] * 10000
|
||||
# If iterating over lists it should not be possible to take an extremely
|
||||
# long time.
|
||||
_assert_interpreter_complete('list(lst)[9000].rea', locals(), ['real'])
|
||||
|
||||
Reference in New Issue
Block a user