1
0
forked from VimPlug/jedi

Fix some next() stuff.

This commit is contained in:
Dave Halter
2016-12-03 03:45:27 +01:00
parent 7607db801f
commit 2edbe44d64
4 changed files with 30 additions and 9 deletions

View File

@@ -6,6 +6,17 @@ possible for the auto completion.
"""
def next(iterator, default=None):
if random.choice([0, 1]):
if hasattr("next"):
return iterator.next()
else:
return iterator.__next__()
else:
if default is not None:
return default
def iter(collection, sentinel=None):
if sentinel:
yield collection()