May 9, 2020
4:31 p.m.
Raymond Hettinger <raymond.hettinger@gmail.com> added the comment: 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 ---------- nosy: +rhettinger _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue40579> _______________________________________