Message294835
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 |
|
Date |
User |
Action |
Args |
2017-05-31 12:01:16 | mjpieters | set | recipients:
+ mjpieters |
2017-05-31 12:01:15 | mjpieters | set | messageid: <1496232075.99.0.36248414101.issue30524@psf.upfronthosting.co.za> |
2017-05-31 12:01:15 | mjpieters | link | issue30524 messages |
2017-05-31 12:01:15 | mjpieters | create | |
|