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 mjpieters
Recipients mjpieters
Date 2017-05-31.12:01:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496232075.99.0.36248414101.issue30524@psf.upfronthosting.co.za>
In-reply-to
Content
I'm not sure where exactly the error lies, but issue 27128 broke iter() for Argument Clinic class methods. The following works in Python 3.5, but not in Python 3.6:

from datetime import datetime
from asyncio import Task

next(iter(datetime.now, None))
next(iter(Task.all_tasks, None))

In 3.6 StopIteration is raised:

>>> next(iter(datetime.now, None))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
StopIteration
>>> next(iter(Task.all_tasks, None))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
StopIteration

(In 3.5 a `datetime.datetime` and `set` object are produced, respectively)

The only thing these two methods have in common is that they are class methods with no arguments, parsed out by the Argument Clinic generated code (so using _PyArg_Parser).

What appears to have changed is that iter() was switched from using PyObject_Call to _PyObject_FastCall, see https://github.com/python/cpython/commit/99ee9c70a73ec2f3db68785821a9f2867c3f637f
History
Date User Action Args
2017-05-31 12:01:16mjpieterssetrecipients: + mjpieters
2017-05-31 12:01:15mjpieterssetmessageid: <1496232075.99.0.36248414101.issue30524@psf.upfronthosting.co.za>
2017-05-31 12:01:15mjpieterslinkissue30524 messages
2017-05-31 12:01:15mjpieterscreate