forked from VimPlug/jedi
Merge pull request #578 from squidarth/554_support_enumerate
Added in support for autocompleting `enumerate`.
This commit is contained in:
@@ -33,5 +33,6 @@ Savor d'Isavano (@KenetJervet) <newelevenken@163.com>
|
|||||||
Phillip Berndt (@phillipberndt) <phillip.berndt@gmail.com>
|
Phillip Berndt (@phillipberndt) <phillip.berndt@gmail.com>
|
||||||
Ian Lee (@IanLee1521) <IanLee1521@gmail.com>
|
Ian Lee (@IanLee1521) <IanLee1521@gmail.com>
|
||||||
Farkhad Khatamov (@hatamov) <comsgn@gmail.com>
|
Farkhad Khatamov (@hatamov) <comsgn@gmail.com>
|
||||||
|
Sid Shanker (@squidarth) <sid.p.shanker@gmail.com>
|
||||||
|
|
||||||
Note: (@user) means a github user name.
|
Note: (@user) means a github user name.
|
||||||
|
|||||||
@@ -207,6 +207,21 @@ class dict():
|
|||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
||||||
|
class enumerate():
|
||||||
|
def __init__(self, sequence, start=0):
|
||||||
|
self.__sequence = sequence
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
for i in self.__sequence:
|
||||||
|
yield 1, i
|
||||||
|
|
||||||
|
def __next__(self):
|
||||||
|
return next(self.__iter__())
|
||||||
|
|
||||||
|
def next(self):
|
||||||
|
return next(self.__iter__())
|
||||||
|
|
||||||
|
|
||||||
class reversed():
|
class reversed():
|
||||||
def __init__(self, sequence):
|
def __init__(self, sequence):
|
||||||
self.__sequence = sequence
|
self.__sequence = sequence
|
||||||
|
|||||||
@@ -35,6 +35,15 @@ next(open(''))
|
|||||||
#? ['__itemsize__']
|
#? ['__itemsize__']
|
||||||
tuple.__itemsize__
|
tuple.__itemsize__
|
||||||
|
|
||||||
|
# -----------------
|
||||||
|
# enumerate
|
||||||
|
# -----------------
|
||||||
|
for i, j in enumerate(["as", "ad"]):
|
||||||
|
#? int()
|
||||||
|
i
|
||||||
|
#? str()
|
||||||
|
j
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# re
|
# re
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user