This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Andrew Black, docs@python, remi.lapeyre, rhettinger
Date 2020-05-09.16:31:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1589041871.28.0.22950547129.issue40579@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2020-05-09 16:31:11rhettingersetrecipients: + rhettinger, docs@python, remi.lapeyre, Andrew Black
2020-05-09 16:31:11rhettingersetmessageid: <1589041871.28.0.22950547129.issue40579@roundup.psfhosted.org>
2020-05-09 16:31:11rhettingerlinkissue40579 messages
2020-05-09 16:31:11rhettingercreate