forked from VimPlug/jedi
Try to re-implement reversed
This commit is contained in:
@@ -235,21 +235,6 @@ class enumerate():
|
||||
return next(self.__iter__())
|
||||
|
||||
|
||||
class reversed():
|
||||
def __init__(self, sequence):
|
||||
self.__sequence = sequence
|
||||
|
||||
def __iter__(self):
|
||||
for i in self.__sequence:
|
||||
yield i
|
||||
|
||||
def __next__(self):
|
||||
return next(self.__iter__())
|
||||
|
||||
def next(self):
|
||||
return next(self.__iter__())
|
||||
|
||||
|
||||
def sorted(iterable, cmp=None, key=None, reverse=False):
|
||||
return iterable
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ def py__mro__(context):
|
||||
# TODO detect for TypeError: duplicate base class str,
|
||||
# e.g. `class X(str, str): pass`
|
||||
try:
|
||||
mro_method = py__mro__(cls)
|
||||
cls.py__bases__
|
||||
except AttributeError:
|
||||
# TODO add a TypeError like:
|
||||
"""
|
||||
@@ -99,7 +99,7 @@ def py__mro__(context):
|
||||
debug.warning('Super class of %s is not a class: %s', context, cls)
|
||||
else:
|
||||
add(cls)
|
||||
for cls_new in mro_method():
|
||||
for cls_new in py__mro__(context):
|
||||
add(cls_new)
|
||||
return tuple(mro)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user