We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e8d582 commit 4e477f8Copy full SHA for 4e477f8
1 file changed
bpython/repl.py
@@ -199,6 +199,9 @@ def __nonzero__(self):
199
"""MatchesIterator is False when word hasn't been replaced yet"""
200
return self.index != -1
201
202
+ def __bool__(self):
203
+ return self.__nonzero__()
204
+
205
@property
206
def candidate_selected(self):
207
"""True when word selected/replaced, False when word hasn't been replaced yet"""
@@ -212,10 +215,13 @@ def current(self):
212
215
raise ValueError('No current match.')
213
216
return self.matches[self.index]
214
217
- def next(self):
218
+ def __next__(self):
219
self.index = (self.index + 1) % len(self.matches)
220
221
222
+ def next(self):
223
+ return self.__next__()
224
225
def previous(self):
226
if self.index <= 0:
227
self.index = len(self.matches)
0 commit comments