mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-16 10:37:52 +08:00
found list indexing issue with sith and fixed it.
This commit is contained in:
@@ -86,12 +86,13 @@ def builtins_reversed(evaluator, obj, params):
|
||||
objects = _follow_param(evaluator, params, 0)
|
||||
if objects:
|
||||
# unpack the iterator values
|
||||
objects = iterable.get_iterator_types(objects)
|
||||
objects = tuple(iterable.get_iterator_types(objects))
|
||||
if objects:
|
||||
rev = reversed(objects)
|
||||
# Repack iterator values and then run it the normal way. This is necessary,
|
||||
# because `reversed` is a function and autocompletion would fail in certain
|
||||
# cases like `reversed(x).__iter__` if we just returned the result
|
||||
# directly.
|
||||
# Repack iterator values and then run it the normal way. This is
|
||||
# necessary, because `reversed` is a function and autocompletion
|
||||
# would fail in certain cases like `reversed(x).__iter__` if we
|
||||
# just returned the result directly.
|
||||
stmts = [FakeStatement([r]) for r in rev]
|
||||
objects = (FakeArray(stmts, objects[0].parent),)
|
||||
return [er.Instance(evaluator, obj, objects)]
|
||||
|
||||
@@ -13,6 +13,13 @@ sorted(arr)[0]
|
||||
#? str()
|
||||
next(reversed(arr))
|
||||
|
||||
# should not fail if there's no return value.
|
||||
def yielder():
|
||||
yield None
|
||||
|
||||
#?
|
||||
next(reversed(yielder()))
|
||||
|
||||
#? str()
|
||||
next(open(''))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user