From 39a5c8501b7e2b011e274731ef8da92ac607a02d Mon Sep 17 00:00:00 2001 From: David Halter Date: Fri, 6 Sep 2013 16:00:12 +0430 Subject: [PATCH] fixed file in python 2.7 with test, fixes #309 --- jedi/mixin/builtins.pym | 7 +++++++ test/completion/std.py | 3 +++ 2 files changed, 10 insertions(+) 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 # -----------------