Python-3.2 coroutine: AttributeError: 'generator' object has no attribute 'next'
You're getting thrown off by the error message; type-wise, Python doesn't make a distinction - you can .send
to anything that uses yield
, even if it doesn't do anything with the sent value internally.
In 3.x, there is no longer a .next
method attached to these; instead, use the built-in free function next
:
next(matcher)
For python version 3.2 the syntax for the next()
in-built function should be matcher.__next__()
or next(matcher)
.