Message368529
The next() function has a different signature than the __next__() method. The former takes one or two arguments. That latter only takes one.
>>> it = iter('abcde')
>>> next(it)
'a'
>>> next(it, 'default')
'b'
>>> it.__next__()
'c'
>>> it.__next__('default')
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
it.__next__('default')
TypeError: expected 0 arguments, got 1 |
|
Date |
User |
Action |
Args |
2020-05-09 16:31:11 | rhettinger | set | recipients:
+ rhettinger, docs@python, remi.lapeyre, Andrew Black |
2020-05-09 16:31:11 | rhettinger | set | messageid: <1589041871.28.0.22950547129.issue40579@roundup.psfhosted.org> |
2020-05-09 16:31:11 | rhettinger | link | issue40579 messages |
2020-05-09 16:31:11 | rhettinger | create | |
|