forked from VimPlug/jedi
autocompletion diggs now pretty deep for generator objects
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
# -----------------
|
||||
# yield statement
|
||||
# -----------------
|
||||
|
||||
def gen():
|
||||
yield 1
|
||||
yield ""
|
||||
@@ -13,6 +12,7 @@ next(gen_exe)
|
||||
#? int() str() list
|
||||
next(gen_exe, list)
|
||||
|
||||
|
||||
def gen_ret(value):
|
||||
yield value
|
||||
|
||||
@@ -22,6 +22,7 @@ next(gen_ret(1))
|
||||
#? []
|
||||
next(gen_ret())
|
||||
|
||||
|
||||
# -----------------
|
||||
# generators should not be indexable
|
||||
# -----------------
|
||||
@@ -39,6 +40,7 @@ for a in get():
|
||||
#? int() str()
|
||||
a
|
||||
|
||||
|
||||
class Get():
|
||||
def __iter__(self):
|
||||
yield 1
|
||||
@@ -63,6 +65,7 @@ g = iter([1.0])
|
||||
#? float()
|
||||
next(g)
|
||||
|
||||
|
||||
# -----------------
|
||||
# __next__
|
||||
# -----------------
|
||||
@@ -90,6 +93,7 @@ for c in Counter(3, 8):
|
||||
#? int()
|
||||
print c
|
||||
|
||||
|
||||
# -----------------
|
||||
# tuples
|
||||
# -----------------
|
||||
@@ -113,3 +117,9 @@ b
|
||||
# `close` is a method wrapper.
|
||||
#? ['__call__']
|
||||
gen().close.__call__
|
||||
|
||||
#? ['co_consts']
|
||||
gen().gi_code.co_consts
|
||||
|
||||
#? []
|
||||
gen.gi_code.co_consts
|
||||
|
||||
Reference in New Issue
Block a user