mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-05 00:18:47 +08:00
reversed mixin
This commit is contained in:
1 parent
b16c4c5b83
commit
740dffebfa
1 file changed
+15
@@ -172,6 +172,21 @@ class dict():
|
||||
return d
|
||||
|
||||
|
||||
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 self.__next__()
|
||||
|
||||
|
||||
#--------------------------------------------------------
|
||||
# basic types
|
||||
#--------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user