1
0
forked from VimPlug/jedi

Rewrite the next function.

This commit is contained in:
Dave Halter
2016-12-03 02:54:09 +01:00
parent da1a163da7
commit 7607db801f
4 changed files with 22 additions and 12 deletions

View File

@@ -6,17 +6,6 @@ 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()