Raymond Hettinger <raymond.hettin...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue40579>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to