diff --git a/jedi/mixin/builtins.pym b/jedi/mixin/builtins.pym index b8ff20b4..d8f45f82 100644 --- a/jedi/mixin/builtins.pym +++ b/jedi/mixin/builtins.pym @@ -26,6 +26,13 @@ def range(start, stop=None, step=1): return [0] +class file(): + def __iter__(self): + yield '' + def next(self): + return '' + + class xrange(): # Attention: this function doesn't exist in Py3k (there it is range). def __iter__(self): diff --git a/test/completion/std.py b/test/completion/std.py index 92637322..67528741 100644 --- a/test/completion/std.py +++ b/test/completion/std.py @@ -13,6 +13,9 @@ sorted(arr)[0] #? str() next(reversed(arr)) +#? str() +next(open('')) + # ----------------- # re # -----------------